As a grampa who has been babysitting for what is now a 2 yr old granddaughter and a 1 yr old grandson, I have had time to observe behavior and ponder the why of it. One behavior seems to take place when the baby can crawl but not yet walk. It involves crawling over to a box or basket of toys and taking them out one at a time and dropping them on the floor.
Back when I was raising my own sons, I noticed this behavior and observed it was always one-way. The baby never felt a desire to pick them up and put them back. At that time, I just dismissed it as a nonsensical behavior that babies--who cannot think--just do, without rhyme, reason or logic. I now think this evaluation was in error.
What made me challenge this notion was the fact that I knew babies often jabbered a lot making incoherent sounds for no apparent reason. I know for example, that they are not trying to communicate anything to me, nor are they intentionally trying to exercise their vocal cords and tongue and lip movements in order to develop their speaking skills. But is there an unapparent reason? I think so and I think it is the same for emptying out a toy box as for jabbering. They do it simply because they can, then because they can, they want to, and further, it is this desire that motivates the action. The process is reciprocal. The act of doing reinforces his implicit knowledge that "he can" which triggers the desire "to do" and so on. It's all about cognitive efficacy, about gaining some modicum of control over his world, though only on the perceptual level.
So the little guy is in fact performing a goal directed action. It is not however an existential but a cognitive one: mental efficacy. This then would explain why he has no desire to put the toys back: that would be a practical, existential goal directed action which he is not yet ready for.
So now when I see him empty out his toy box, I know he is not trying to create an empty one, nor does he desire to create a mess in the middle of the floor. Such concepts as mess and order and disorder have no meaning for him and won't until he learns to speak. No, he is just trying to gain some mastery of this world and himself.
Admittedly, this evaluation of mine will undergo some refinement in the future. There are implications I have not yet fully thought about. For example, does the baby perceive relationships such as the difference between 'in' the toy box and 'out' of it? I think so. Once, before he could crawl, my grandson was sitting on a blanket with a few toys. One of them was slightly out of reach. He grabbed the blanket and pulled it towards him bringing the toy within reach. I marvelled at this bit of awareness on his part. But was he perceiving relationships or the consequences of an action which, later in life, he will reclassify as cause and effect? I'm not sure.
Lately, in concert with mommy and daddy, I've been trying to redirect his attention somewhat. Once when he was emptying out his toy box, I laid on the floor next to him and spoke the word "out" every time he took a toy out. When he was done, I began putting the toys back in saying the word "in" every time. Nothing came of it then. He just looked at me with a blank stare as if to say "toys don't go in toy boxes, are you crazy?" Later we tried this again. This time he took one of his stuffed animals out of the toy box then put it back, then out again. This pleased me because he now knows that there is an opposite direction he can do and this to me, is progress.
In conclusion, I have determined that in babydom, the operative cognitive process is "I can, therefore I will." It is then of course, up to adults to redirect this force towards productive endeavors and away from harm. So if you have a little tyke indulging in this behavior, try to remember that he or she is really not seeking to trash your living room and is not being bad, rather, is being good, very good.