I read that you can max out your attack stat by continually grinding Pokemon that yield Effort Points (EVs) in Attack.
But how does it work? Don't you only gain stats when you level up or use vitamins? How does defeating a Pokemon increase your attack?
This could help you out a bit.
Basically, Game Freak had it programmed into the game that when you defeat a Pokemon, it would give you a certain number of EV's in its best stat (however, there are some cases where a Pokemon gives you EV's for a stat that is not its highest). EV's help you train your Pokemon in its stonger area's, so you wouldn't be randomly boosting a Shedinja's HP while you can raise its attack instead.