Well, it really comes down to what a Pokemon can achieve. I'll give you some examples to explain what Pokemons can use what EV's. We are gonna be comparing Base Stats, and see which times would be good to go Physical, Special, and Mixed.
Physical EV example: Scizor
Now, this guy is well known for being one of the best physical attackers in OU. With a Base Attack stat of 130, you can see why people would want to invest EVs in that, rather than its Base Special Attack STat, which is a measly 55.
Special EV example: Alakazam
Ok, look at this guy, with that amazing 135 Base Special Attack stat. It literally would define the definition of sweeping, if used right. Now, seeing that his special attack is good, why would you want to invest it in that low, undesirable Base 50 Attack? Nah, you need the most power you can get for your Special Attack :D
Now, there are some cases where you have a Mixed Pokemon
Basically, these Pokemons go in there and wreck havoc and their mission is to destroy anything that gets in their way, from the all-known Specially Bulky Blissey/Chansey to the ever present Defensive Ferrothorn/Jellicent. The perfect example I see fit here is Salamence.
A threat in OU, MixMence is used to take out anything, and if possible, everything. Smogon uses an EV spread of 64 Atk / 192 SpA / 252 Spe, to maximize his capabilities. Now, let us see his Base Stats for Attack and Special Attack. They are: 135Atk, 110 SAtk. So, most EVs were thrown into MixMence's SAtk because it is lower than it's Attack stat, meaning it will need more investment to take be effective. Now, that doesn't mean that you should leave it's higher stat untouched. You should definitely invest some EVs, but just enough to make it do the damage you want it to do.
Well, hopefully this helped you see how to Usually (not always) determine the EVs you should invest for a Pokemon. In some cases, you may see gimmicks where a person is using a Special Gyarados, but know that it is very hard to pull off without experience, and usually a very stupid thing to do, if you take battling seriously. Hope you understand this now.