Energy from the sun heats the Earth unevenly, causing air movements resulting in changing weather patterns.