Cold air is more dense than hot air. More dense means more oxygen per unit of air. This means the engine computer will inject more gas per cycle to maintain the proper fuel/air ratio. This makes you use more gas, but also makes your car a little more powerful.
Coupled with cold weather is generally a decrease in humidity. That’s why we start itching and use a lot of chapstik in the wintertime. Decreased humidity means less water in the air, which again means that a given unit of air will have more oxygen in it, because it’s not being crowded out by water.
There would also be an aerodynamic effect – dense air is harder to push through than not-dense air, which is why airplanes can go much faster when they’re up high than when they’re at ground level. Admittedly, the aerodynamic effect on a car tooling along at 60mph is much less than the aerodynamic effect on an airplane cruising at over 600mph, but it is still there.
Now, lubricants do have an effect, but not for very long. Once your engine warms up, it’s really hot in there whether it’s 80 or 40 below outside. It’s plenty warm enough for the oil to flow as expected.
Your transmission will gain residual heat from the engine as well as make heat of its own when its components spin, so the transmission fluid/oil will also warm up to flow normally.
Unless you make a lot of short trips that don’t allow your fluids to come up to temperature, you won’t have a huge effect from higher viscosity in your lubricants.
But, all of these little things (and a few more factors to boot - for example, pushing through snow is more work than driving on clear, dry pavement, so if you do much of that your mileage will drop) add up to provide for the drop in mileage.