Looking further into this practice, there seem to be two reasons for lowering yards:
1. Crew safety aloft
2. Lower the ship’s centre of gravity.
If the yard is lowered to on or near mast cap below, then crew do not have to climb to upper sections of mast where there are fewer rat lines on shrouds to furl the sail. The sail is heavy and could be wet so better to furl the sail with yard lowered rather than trying to pull sail up to yard while balancing on foot rope (horse?).
Yards could be heavy, so they are lowered to reduce centre of gravity to reduce risk of ship capsizing. In a storm the yards (and even top mast) could be lowered to deck. In port, as a ship is unloaded it rides higher in the water so the lowered yards compensate for this by lowering the centre gravity.
Fascinating stuff, feel free to correct me if I’m wrong in any way.
Cheers