The fluids cause the larynx muscles to contract uncontrollably by reflex. Even if liquid doesn't get into the lungs the spasms caused can be so severe and sustained as to prevent adequate ventilation leading to asphyxiation. This can be by direct irritation, rinsing out of vital substances from the lungs, and blockage of airways. Research shows that salt water has similar chemical properties to body fluids and won't transfer as rapidly across the lungs. On the other hand, fresh water has fewer chemically similar properties and it is rapidly taken into the system.
Fresh water can really mess up the body's mineral balance and cause blood cells to swell and burst.
Most important seems to be the collapse of the air sacs in the lungs which is caused by both fresh and salt water. The chemicals that help to keep the lungs working are washed out and parts of the lungs collapse and air can't get there. Then a lack of oxygen develops and the lungs get stiff and swollen. That is how death may occur later, perhaps days after drowning. Another problem is chemical imbalances set up by the fluids absorbed and the body's inability to exchange gasses in the lung due to damaged tissues.