I watched a few LoL matches here, and I saw that sometimes there is the "6th player" on both sides. He does not actually play, but rather enters the game, stays in the base and comments on the game. How can this be done? Is it a game feature, or is it some sort of a hack?
It is not a game feature nor a Hack.
The 6th player is a Mod/GM that can only be added by Riot staff; this player has the ability to see the map without fog of war and it is also capable off seeing both side stealth units.
Unfortunately I dont have a source to back up my statement, you can check on any of the matches where a 6th player is, at least one of them will have the name of a Riot employee, most likely Phreak and the game type play is a Draft Pick Custom Game.