a pokemon can have 510 EVs in total, and for every 10 Evs in one stat is one stat point (i think)
a wild pokemon prominent in HP, Attack, Defense, Sp. Atk, Sp. Df or speed will have a single Ev for its most prominent stat (the more evolved a pokemon is, the more points it will give). when your pokemon defeates a wild pokemon, it gaines an EV or 2 or maybe 3 for each wild pokemon you defeat. you can have 252 at the most in each stat. you can also train your pokemon against specific wild pokemon to gain specific stats. people do this competitively to be slightly stronger. when i do this, i notice a distance in power in competitive. what im saying above is just what i think is the most logical way to have wild pokemon's evs be.