The effect, known as Fata Morgana, occurs when there are several layers of hot and cold air, causing an optical deformation on the horizon.