Seriously, just as they are thermophiles who always seek the warmest spot, they instinctively will seek the coolest spot in the garden. Also, they have learned the advantage of shade as a form of camouflage. All the better for plucking their feathered prey out of the sky.
Sometimes an elderly cat will lie in the sun because the thermal equilibrium will make his or her old bones less painful, as it is the difference between internal and external temperature gradients that many humans know make our arthritic symptoms more severe. Cats are well smart.