Each time you defeat a pokemon, you gain a certain number of EVs. Those EVs boost a stat. Which stat, and how much, depends on the Poke you defeated - charts are available in a number of places.
If you're EV training, that means you're being selective about what you battle to maximise favoured stats, as you can only have 510 EVs total on a Poke and 255 per stat.
To speed up the process, use vitamins (each boosts their respective stat by 10 EVs, but only if you have less than 100 EVs in that stat) and braces (Macho Brace doubles all EVs obtained, but for training specific stats the Power items from the Battle Tower are better).