Creatures in the Bestiary use an ability score array of three 10s and three 11s (because 3d6 averages 10.5).
Hence why when you add class levels to a monster the Bestiary says to modify their stats with +4/+4/+2/+2/+0/-2. It moves them to the 15 point-buy array (15 14 13 12 10 8) that's usually used for NPCs with PC class levels.
Racial bonuses in Pathfinder are always even numbers, so you know that if the total is an odd number it was one of the three elevens, and if it was an even it was one of three tens.
The example ogre in the Bestiary has 21 Strength, which is an odd number, and 8 Dex, which is even. So we know that ogres have a racial modifier of +10 Strength and -2 Dexterity.
Then you replace those 10s and 11s with the results of 3d6.