Generation I
The EV system was introduced in Generation I, where it was also called Stat Experience or Stat Exp.
The Pokémon data structure contains two EV bytes for each the five stats (HP, Attack, Defense, Speed and Special), starting at zero when caught and with a maximum EV of 65535 for each stat. When a Pokémon is defeated, its base stats are converted to effort points and then added to the EVs. For example, defeating a Mew grants 100 effort points to each EV. (Defeating 656 Mew, therefore, will give a Pokémon maximum EVs in each stat.)
EVs are factored into the Pokémon's stats when it levels up. Additionally, EVs are calculated into stats when a Pokémon is taken from Bill's PC; this is called the box trick. A Pokémon which reaches level 100 can continue to accrue EVs up to the maximum of 65535 in each stat, and use the box trick to have those EVs factored in.
Vitamins add 2560 to one stat's EV, but cannot raise a stat above 25600. Unlike the Exp. Share in later games, the Exp. All did not share EVs.
At level 100, the formula for determining the stat difference between a Pokémon trained in that stat and an untrained Pokémon is .
Generation II
EVs behave the same in Generation II as they did in Generation I. Both Special Attack and Special Defense share the EV for Special to maintain compatibility. The box trick can still be used.
Generation II introduced the Pokérus, a rare status ailment which doubles the effort points gained in battle.
Generation III
Generation III completely overhauls the effort value structure. Effort points are now separate values from the base stats. Defeated Pokémon give out 1, 2 or 3 effort points to a particular stat, depending on species (see list of Pokémon by effort value yield). However, in battles that do not give any experience (such as in the Battle Tower or if the Pokémon is level 100), Pokémon will not gain any effort points. At level 100, a Pokémon's stats will be one stat point higher in a specific stat for every four effort points gained in that stat. For every Pokémon that has gained Effort Points in battle, stats will be recalculated upon leveling up, except for Deoxys, whose stats will be recalculated after every battle instead.
Pokémon are limited to a total of 255 effort points per stat, and 510 effort points in total. However, at level 100, since a stat increases by 1 point for every 4 effort points, only 252 effort points are required to maximize a stat.
Vitamins add 10 effort points, but cannot raise a stat above 100, or raise the total above 510. A new vitamin, Zinc, enhances Special Defense.
If a Pokémon holds an Exp. Share, it will receive effort points even if the battling Pokémon has maxed out its effort points. If the Pokémon with the Exp. Share has Pokérus, the amount of effort points received is doubled.
A new held item, the Macho Brace, doubles the effort points gained in battle. In combination with the Pokérus, a Pokémon can gain four times the normal effort points. However, the effects of the item do not transfer to a Pokémon holding an Exp. Share.
In Pokémon Emerald, certain Berries that were previously only used to make Pokéblocks can decrease certain effort values by 10 effort points, while increasing the happiness of the Pokémon they were used on.
Generation IV
Most of the Generation IV EV system remains unchanged from Generation III, however, EV-reducing berries will reduce Effort Points to 100 if the current Effort Points for the stat were above 100.
A new series of items exist which give an additional four effort points per Pokémon defeated. Each applies the bonus to a different stat, in addition to the normal effort points gained. The bonus effort points are also doubled by the Pokérus. The effects of these items do not transfer over to a Pokémon holding an Exp. Share.
If a Pokémon has alternate forms that change its stats (e.g. Giratina), any effort points acquired will be applied to its stats when the form is changed, allowing the player to boost their Pokémon's stats without having to level it up.
Generation V
In Generation V, most of the EV system remains unchanged from Generation III and IV. EV-reducing berries no longer reduce Effort Points to 100 if the points were above 100; instead, only 10 EVs are deducted. Pokémon can now gain effort values from battling even at Level 100, and stats are recalculated at the end of every battle instead of only after leveling up, much like Deoxys in the Generation III games.
A new kind of item called Wings are introduced which are similar to Vitamins but only give 1 effort point when consumed. Unlike Vitamins however, Wings are not subject to the 100 EV limit and can be consumed until the maximum value of 255 for one stat (or a combined 510 for all stats) is reached. There are 7 types of Wings in total, but only 6 Wings contribute to a specific stat: the Pretty Wing does nothing at all. Wings can be collected from the shadows at Driftveil Drawbridge or Marvelous Bridge.
As for Roselia, it had 1 EV in Spatk in Gen III, but that was changed to 2 EVs in Gen 4 once Budew was added.
http://bulbapedia.bulbagarden.net/wiki/EV