Most, if not all, critical features of organisms evolved in this manner: wings, eyes, bones etc.
Darwin originally called these phenomenon “preadaptation,” but this suggest that the creature was somehow preparing for this novel features emergence (that it could know in advance about flight).
Recently, Stephen Jay Gould and Elizabeth Verba proposed that this be called: exaptation, because it is outside (the ex part of the term) adaptation.
Which is a beautiful way of describing creativity -- it is a process of novelty that is outside of fitting into any existing purpose.
A wing is a great example of exaptation in nature. A wing can be sexy, ward off predators, keep eggs warm, and be used for flight.
The wheel as an example of exaptation in innovation. The wheel is used for transportation, to generate power (watermill), or as a gear in an engine.
... is to ask yourself: "what else can this [any physical object] do?"