The people I know of hack in competitive or shiny Pokemon because they have a busy life and don't have the time to breed the Pokemon themselves. If you're talking about the people who hack in Pokemon with illegal stats/moves (like a shiny reshiram with blast burn and 600 EV's in attack), I'm pretty sure it's just a way for them to troll online, or they're just having fun with it, and most likely don't care if they get banned from Online battles.
There are a lot of methods of hacking Pokemon, but the two I've heard the most about are Action Replay and PKHeX.