Cats like to squeeze themselves into small spaces. They crawl into drawers, baskets, and boxes. They climb into corners of closets, hide under beds, and station themselves in the corner of your favorite easy chair. Before you’ve even unpacked your groceries, your cat is curled up inside one of the paper bags.
If it is small in area and has at least three sides, your cat will probably climb inside and make himself comfortable.
It isn’t difficult to imagine why cats like being enclosed. They feel snug and protected in smaller, defined places. Cats have a natural need for warmth and protection; their ever-present instinct tells them to be alert to dangers that might sneak up on them when they are dozing. If the enclosure has a top, that’s even better.
You should make sure your pet has a variety of snug places where he can curl up and take a nap. Pet stores and pet supply catalogs carry an endless variety of beds, boxes and hideaways from which to choose. But a simple homemade Shangri-La can be made from a cardboard box tipped on its side and lined with a soft pillow or blanket. An upside-down box with holes cut in the sides also will make a nice retreat. Or just open a drawer once in a while and see if your kitty takes up residence. Paper bags (but not plastic ones) also make great hideaways.
Some cats like their cat carriers, too, especially if they’ve had plenty of opportunity to explore them. Place the carrier in a room where your kitty likes to hang out and remove the door, or prop it open. Put treats or favorite toys inside, and let him discover them on his own. If the carrier is furnished with his favorite blanket, the familiar scent will help him to accept it, and you may find him nestled in there when he’s ready for a nap. Then when it’s time for a visit to the veterinarian, it won’t be so scary because he’ll be in his “home away from home.”
Source: https://www.petplace.com/article/cats/pet-behavior-training/why-do-cats-like-small-places/