I’m guessing you are referring to wooden windows and doors:
Wood is porous and as a result, it tends to absorb moisture, which causes expansion. Unprotected wood is capable of expanding 6 or more inches during wet seasons. By contrast, when the air is dry, the same wood will dry out and slowly contract, causing it to grow smaller. Hot temperatures will also cause wood to swell to a certain degree, but for the most part, the swelling is more due to moisture in the wood fibers than it is to heat. The same is true of cold air, causing the wood to contract. Cold air tends to be much drier than hot air, so the lack of moisture causes the contraction.
If the wood doesn’t have room to expand then it will bend and warp.