Lots of insects use this go inside strategy.
House flies have zero tolerance for cold. A small number hide out in barns, sheds and houses where the temperature is just above freezing or warmer. The eggs, pupa and adults that are outside ALL die. When spring comes, the survivors come out, and start new batches of flies. You don’t see many flies in the spring, but they are everywhere by summer.
Stink bugs use the same strategy.
Stink bugs are even worse. We will see them crawling around inside the numerical dials of gas pumps here in SW PA. Flies don’t even try to get in those spots.