It only needs to find a location that seems suitable for building a nest.
Depending on the aircraft, ground equipment, storage areas, maintenance conditions, and where the object was actually located, an insect could potentially create a structure in a protected space and remain undisturbed for a period of time.
Another possibility is that the object was transported into the cargo area rather than built there.
That distinction is important.
Finding an old nest inside or near an aircraft does not prove that an insect constructed it inside the aircraft.
It could have arrived with cargo, equipment, maintenance materials, baggage, or other objects.
Without knowing exactly where the object was discovered and how long it had been there, its history cannot be determined from the photograph alone.
It Could Have Been Built Somewhere Else
This is one of the most reasonable possibilities.
Airports move enormous amounts of material.
Cargo, containers, pallets, ground equipment, tools, packaging, and other objects are constantly transported from one location to another.