Cage eggs are 20% better for the environment on an energy basis than other production systems. This means less food or energy is needed to produce the eggs as the hens don't need to search out the food or interact with other hens to get their share.
Hens like to be cool in the summer and warm in the winter. They seek shelter from the rain and a cool spot when its hot. High temperatures for extended periods as experienced in Australian heatwave conditions can be fatal to the domestic hen as its ancestors came from the cool jungles of Asia where small groups scratched around on the cool jungle floor. Being in a small group in an air conditioned cage with access to water and food must seem like an ideal situation to lay an egg.