A lot of explanations have been given, but they are not consistent. At one time, it is insisted they are a mindwipe device, at other times, the pokemon are asserted to have their own will. As for what the pokemon experiences inside, that wasn't shown until gen 6, where it's a customizable environment.