There are many possible explanations for the circling ritual cats perform prior to lying down for a nap.
One theory is that cats circle around and tightly coil their bodies to conserve body heat.
So, in cold or hot climates, cats optimized a biological reason for turning around before bedding down.