>>14989984When generated, each pokemon rolls for their stats individually.
0-31 in each stat (0 worst 31 best). Same concept as EVs but not divided by 4.
When breeding a pokemon will inherit some of its stats from parents (randomly picking which one). Various held items have various effects on this. Check around.
When generated in the wild, they are completely random. In the friend safari they're guaranteed to have at least 2 stats perfect (31).