Cats are mysterious creatures. Whenever a cat sees a small space, they seem to think it’s a challenge to cram their bodies into that space right away, much like kids in the 50’s used to try cramming themselves into telephone booths for kicks.
Yet this odd behavior actually makes sense (from a cat’s point of view). Just as gunslingers of the Old West used to prefer sitting with their backs to the wall so no one could sneak up on them, cats prefer small spaces because it gives them a sense of security (unless, of course, the cat gets stuck in that small space).
Essentially, cats believe if you hide and run away from your problems, they’ll go away all by themselves. That makes cats about as intelligent as most humans int hat regard.