A sealed box that fills with water which never got in
Condensation inside a sealed enclosure, and why venting makes it drier.
A sealed box can fill with water that never got in because the water was already there all along, carried invisibly as vapour in the air trapped inside the box the moment it was closed, and that vapour condenses into visible liquid whenever the box's own temperature falls far enough for the trapped air to give some of it up.
Why sealing a box in does not seal moisture out
Ordinary air, even air that looks and feels perfectly dry, carries a genuinely significant amount of water vapour dissolved invisibly within it, and how much water a given volume of air can hold depends strongly on that air's own temperature: warm air can hold considerably more invisible moisture than cold air can. An enclosure sealed shut on a warm afternoon traps whatever air happened to be inside it at that moment, humidity and all, and sealing the box does nothing to remove that trapped moisture, it only stops any more from getting in or the existing amount from getting back out. As the enclosure cools overnight, the air inside it cools along with it, and cooler air simply cannot hold as much invisible water vapour as the warmer air it used to be, so the surplus has nowhere left to stay invisible and condenses out as liquid droplets on whatever surface inside the box happens to be coldest, very often the inside of the metal or plastic shell itself, or a circuit board mounted close to it.
The sweating-glass comparison
A glass of iced lemonade left on a table on a warm day quickly grows a visible layer of beads on the outside within minutes, water that was never poured into the glass and never touched the drink at all, condensed directly out of the surrounding room air the instant that air met the glass's cold surface and could no longer hold onto the moisture it had been carrying invisibly a moment before. Nobody spilled anything, and the glass itself has no leak; the water simply appeared because the air around the glass crossed the temperature at which it could no longer hold what it already contained. A sealed electronics enclosure that cools overnight is doing precisely the same thing on its inside surface rather than its outside one, and precisely because the enclosure is sealed, the condensed water that appears there has no easy way to evaporate back out again the way it eventually would off the outside of a glass sitting in a ventilated room.
Why cooling overnight is what actually condenses the water
The specific temperature at which air can no longer hold all of its dissolved moisture and starts giving some of it up as liquid is called the dew point, and any surface cooler than that dew point will collect condensation on contact with humid air regardless of whether that surface is a drinking glass, a car windscreen on a cold morning, or the inside wall of a sealed enclosure. A box sealed during the warmest part of the day traps air with a correspondingly high capacity for invisible moisture, and the overnight temperature drop that follows in the field, often a swing of many degrees between afternoon and early morning, can easily carry the enclosure's internal temperature below that trapped air's own dew point well before sunrise. This is why the fault shows up specifically as a morning problem on outdoor equipment, condensation found pooled or beaded inside a box that was demonstrably dry, and demonstrably properly sealed, the previous evening.
One figure worth keeping in mind
Ordinary air at a comfortable room temperature and a fairly typical humidity can be carrying a genuinely surprising quantity of invisible water vapour, enough that a modest, fully sealed enclosure closed up on a warm, humid afternoon can wake up with a measurable puddle inside it after nothing worse happened overnight than an ordinary seasonal temperature drop, with no leak, no failed seal, and no rain anywhere near the equipment at all.
Why a perfectly sealed box can still get wetter every single day
A genuinely perfect seal, one that never lets any air cross it in either direction, would at least cap the problem at whatever moisture was trapped inside on the day the box was closed. Very few real enclosures achieve that in practice, because the same daily heating and cooling that drives condensation in the first place also drives the enclosure's internal air to expand and contract, and that expansion and contraction has to go somewhere. As the box cools and the trapped air contracts, the drop in internal pressure draws in a small amount of outside air through whatever imperfect gaps the seal actually has, and that incoming air carries its own share of ambient humidity with it. As the box warms again the following day, it breathes back out, but only the drier air near the top tends to escape easily, while the added moisture, once condensed onto an internal surface overnight, stays behind as liquid rather than evaporating back out through the same narrow path it came in by. Repeated over enough daily cycles, an imperfectly sealed enclosure with no deliberate venting can accumulate meaningfully more trapped moisture over weeks than it ever held on the single afternoon it was first closed up, purely from this slow daily breathing in and out.
What this changes in practice
The counterintuitive fix for this specific failure is to deliberately compromise the seal rather than tighten it further, fitting a vent that is engineered to let air, and the moisture riding along with it, pass slowly in and out while still keeping out liquid water and dust, commonly built around a membrane that blocks droplets and particles by size while remaining porous to water vapour and ordinary air pressure changes. A vented enclosure never traps one fixed batch of humid air to begin with, so it never accumulates a large surplus of moisture to condense out overnight the way a fully sealed box does, and the same membrane that lets it breathe gradually also equalises internal pressure continuously rather than only through whatever accidental gaps an imperfect seal happens to leave, which removes the slow daily pumping effect described above at the same time as it removes the overnight condensation itself.