Why does a cold front cause heavy rain?

A cold front causes heavy rain because it marks the boundary between a mass of cold air and a mass of warm air. When a cold front moves into an area, the cooler, denser air displaces the warmer, less dense air. As the warm air is forced to rise over the cold front, it cools quickly, causing the moisture in the air to condense and form clouds. These clouds can then generate heavy precipitation, such as rain or thunderstorms, as the condensed moisture falls back to the ground. The steep temperature contrast along the cold front also creates instability in the atmosphere, further enhancing the chances of heavy rain and thunderstorm development.