Normally, this is the process that goes through my mind when trying to come up with an EV spread:
If I want a sweeper: 252 speed, 252 in the correct attack stat, and 4 in one of the defenses.
If I want a bulky sweeper: 252 in the correct attack stat, 252 in HP, and 4 in one of the defenses.
If I want a defensive wall: 252 in HP, 252 in one of the defenses, and 4 in the other defense.
You get the idea. I basically just put 252 in two stats, leaving one for putting 4. However, as I'm reading Smogon analysis and watching a few videos, I found that people tend to put stats like 108 or some other random stat. I literally just opened up Smogon strategy pokedex, and just clicked on a random Pokemon that happened to be Alcremie, and it puts 228 in it's defense stat. I saw this kind of distribution a lot. I want to know two things: where do they get these numbers? And how can I train myself to get these numbers? I'm battling in gen 7.