The Hammerspace theory is a less-than-serious attempt to explain this phenomenon. In a nutshell, it attributes it to an extra-dimensional storage area, named 'Hammerspace', which is accessible when needed. It is also used to jokingly explain a number of the peculiarities of Japanese video games, particularily console role-playing ones; for example, how come a character wielding a sword half his size does not appear to be carrying one until he actually enters combat?
The laws of physics in Hammerspace are fairly peculiar, as is the nature of the link between the area and its users. This can be observed in - for example - the way Tidus, video game hero, is able to carry 99 Potions and 99 Hi-Potions with no trouble, but has no room to carry 100 Potions no matter how many other items he has.
Hammering has spread to a number of web comics, such as Okashina Okashi and El Goonish Shive.