I understand most of what each number represents, but monster/NPC statblocks often have a number in the damage section before the damage roll in parentheses. For example, for a Sahuagin Priestess (MM, p. 264), one of her attacks looks like this:
Bite.Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 3 (1d4 + 1) piercing damage.
The Introduction to the Monster Manual discusses how to read the damage of attacks in the stat block:
Hit. Any damage dealt or other effects that occur as a result of an attack hitting a target are described after the “Hit” notation. You have the option of taking average damage or rolling the damage; for this reason, both the average damage and the die expression are presented.
The average result of 1d4 + 1 is 3.5, which rounds down to 3.
Some DMs prefer to save time by using average damage instead of rolling every time. The average is calculated as you'd expect: ([min damage] + [max damage]) / 2, and then rounded down. In the case of your example, this results in (2 + 5) / 2 = 3.5. The 3.5 is then rounded down to 3 to get the average damage.