For every gallon of gasoline you burn you generate about a gallon of water. Burning gas is simply a chemical reaction between the hydrogen in the fuel and the oxygen the engine sucks in. Result, water and a bunch junk; CO2, CO, NOX, etc. They initially exists as a vapor. Cool it and you get liquid water. The vapor goes out the exhaust and blows by the piston rings into your oil and out the crankcase vent. Cool the gasses that go out the vent and you get water. I have my vent pipe insulated. To keep the water from condensing in the oil or get rid of the water that condensed while the engine was warming up you need hot oil to vaporize the water.
The valve that by-passes your oil cooler to keep the oil hot, if you have one, is to insure your oil cooler only receives hot oil, is designed to keep the oil at at least 180 degrees. We all know they don’t work well in winter when they are needed.
It is commonly called the vernatherm valve. Supposed to do what the thermostat does in your car.
When you shut your hot engine down the crankcase is full of hot water vapor. As the engine cools the water condenses on all the cooling steel and aluminum parts in your engine if the ambient temperature drops below the due point of that hot vapor as it does in the winter. The oil has additives to protect against this but they do a poor job over time. That’s why many of us use CamGuard.
https://aslcamguard.com/
After flight in cold weather I remove the the oil dip stick and connect my shop vac to the engine vent tube for about five minutes while I close the hangar up to remove that hot vapor.
For further reading on the subject:
https://www.kitplanes.com/separator-or-condenser/