If you have an indoor cat, you may have noticed it doing an unusual thing. Just about the time you settle down for the night the cat will get up and leave the room. A little later it will walk back into the room, make its way around the walls, and go back out again. A little later, one more time around. What's going on here?
Cats are very territorial animals. This is one reason why pet owners have their cats spayed: if they are not, they will mark up the house with a strong-smelling spray that lets other cats know "somebody lives here." But even if you're a cat who doesn't spray, it's still a good idea to take a walk around your territory and make sure no one else is moving in.
This is exactly what your cat is doing during these nightly round-the-house tours. Try following it, quietly, some time. Often you will find the cat walks through every room in the house, staying close to the walls, as if drawing a line around the outer perimeter of its domain. In the wild, the area inside this boundary would be hunted by this cat alone, unless someone else wanted to present a challenge for part of it.
Of course, if you have an outdoor cat you won't see this activity, because its personal domain extends far out into the neighborhood. But you can be sure that about once a day, your cat walks all the way around its territory, doing battle with any invaders and generally keeping stock of things. It's good to be king.