[Andy exactly describes][1] the mechanism I have also seen . Because of this I favor inverted bucket case designs which do not rely on seals, wherever possible. "The definition of waterproof is the hole in the bottom is bigger than the hole on top"
Note on "trapped humid air when box was closed" At 25C, there is [22g/m^3 of water][2], or 22mg if this is a 1L box. Thats a ~3mm ball of water.

I found scotch-brite pads to be a good breather vent and bug stopper for fixed equipment.

I have also just cut a disc of Gortex raincoat fabric and siliconed it into the case. (on top of metal mesh if you have gnawing bugs). I did some transpiration experiments years ago testing the 6 different types of breathable fabrics that I could get. (silicon fabric onto top of cup of water, and leave in hot water cupboard). Genuine Goretex was more than 2x better than the clones at the time.

There are specialist screw in and stick on [breathers][3] nowadays. (A lot smaller than the 1.5" Gortex patches I used though)

Mounting the case at 10 degrees to horizontal results in the water pooling in the corner. It is good to plan for where the water will go. A small drain hole there will see the overpressure force liquid water out the drain hole during the day. Put a some type of wick in drain holes so water drops do drain down.

A sunshade and/or white colour reduces the internal temperature, and therefore the overpressure that forces air out during the day (and thus sucks moisture in at night. As an aside, there is [IR reflective paint][4] that results in dark colors in the sun being 10degC cooler.

In a recent datalogger design used in the splash zone on boats, I put a hygrometer chip in, just to know if water had leaked in.


  [1]: https://electronics.stackexchange.com/a/388871/107557
  [2]: https://www.engineeringtoolbox.com/maximum-moisture-content-air-d_1403.html
  [3]: https://www.gore.com/products/categories/venting
  [4]: http://www.resene.co.nz/comn/whtsnew/cool_colours.htm