Cats like boxes because they feel safe and secure in them. Boxes provide a confined and enclosed space that cats can hide in, hunt prey and feel warm. This is an instinctive behavior for cats as they are ambush predators.
In addition to feeling safe, boxes also provide new and exciting territory for cats to explore. They can use boxes as hunting hideouts and some cats see them as warm places to sleep.