Here is an image that describes the effect:
Image licensed CC-BY by The School of Physics UNSW
This illustrates a the effect of a near-surface density gradient that is low density (warm) at the ground and increases (gets colder) with height. The photons from the sky that pass close to the road are refract toward the observer and you see a false image of the sky as an inferior mirage. The other photons do not pass through the strong density gradient and are not bent and you see the true positions of the objects.