For pet cats, all the toys in the world can't compare to a simple cardboard box.

But why are our feline friends so drawn to boxes and other enclosed objects, including bags, laundry baskets, suitcases and backpacks?

Seeking out confined spaces is an instinctual behavior for cats. In the wild, these areas allow the animals to both hide from predators and surreptitiously stalk prey.

"Cats like boxes because they are cryptic animals; they like to hide," Stephen Zawistowski, science adviser for the American Society for the Prevention of Cruelty to Animals, told Business Insider. "And a box gives them a place of safety and security."

While inside a box, cats feel that they cannot be snuck up on from behind or the side — anything that wants to approach them must come directly into their field of vision. In effect, such hiding spaces allow them to watch the world around them without being seen.

And if something interesting passes in front of the cat — be it prey or a toy — it can dash out to get the object, and then quickly return to its safety spot.

Boxes also provide cats with a cozy, safe place to sleep, which is very important given that the felines sleep for up to 20 hours a day.

Follow Joseph Castro on Twitter. Follow us @livescience, Facebook & Google+.