DOT 3 and DOT 4 brake fluid are glycol based and absorb moisture over time. Moisture contamination causes the fluid boiling point to drop (which could lead to fluid boil and brake fade during hard use).
Moisture contamination also contributes to internal corrosion in the calipers, wheel cylinders, and steel brake lines. The reason for replacing fluid periodically is to get rid of contaminated fluid and restore fluid heat and corrosion resistance.
Moisture seeps in through microscopic pores in rubber seals and hoses. It also enters every time someone opens the master cylinder reservoir to check the fluid level. Most fluid reservoirs are transparent so level can be checked without having to open the lid.
Brake fluid is so hygroscopic (attracts water) that leaving the lid off a can of fresh brake fluid can ruin it overnight. It will absorb so much moisture from the air that it becomes too badly contaminated to use.
How often should the fluid be replaced? By the time a new car is only 12 months old, its brake fluid contains about 2% water. After 18 months, the water content is approaching 3%, which is enough to lower the boiling temperature by 25%. After several years of service, it is not unusual to find brake fluid containing seven to eight percent water. For this reason, many experts recommend replacing the fluid as a preventative maintenance service every two years or 24,000 miles. At the very least, it should be replaced when brakes are relined.