The AIM-9L doesn't lock on to the hottest thing, it takes an IR picture of the scene and follows the targeted "blob" in the image that's generated. Additionally it has laser proximity fusing so it knows when it is close to the shape it is tracking. By not simply picking the hottest thing in a scene you can't hide in front of the sun anymore, and the effectiveness of flares is reduced.
The only thing needed to generate a "blob" good enough to target is sufficient ΔT between the scene and the targeted object.
The objects, and they have been curiously consistent with calling them "objects", definitely have sufficient ΔT compared to the background sky if they are made of any solid material that has been exposed to sunlight for any period of time.
Isn't heat detected by infrared? What's the difference?
Countermeasures like flares try to trick a missile's sensor into thinking the hot object it was staring at was the flare going that way and not the maneuvering aircraft going the other way. Modern IR tracking missiles try to stay locked on the object by ignoring hotter or cooler objects that might end up in its view.
That's the extent of my knowledge about the AIM-9 Sidewinder.