From Bulbapedia, the community-driven Pokémon encyclopedia.
The box trick is a method in the core series Pokémon games that allows a Pokémon to change its stats due to effort values without leveling up. It works in Generations I and II.
Usually, a Pokémon's stats are calculated upon leveling up; however, Pokémon stored in the PC have only the numbers used in the calculations stored (namely the EVs, IVs and base stats), so depositing and withdrawing a Pokémon from the PC will cause its stats to be recalculated. This method can be used to EV train level 100 Pokémon by using vitamins.
From Generation III onward, the trick is obsolete. In these games, effort values are immediately applied to stats as soon as a Pokémon's effort values are modified.