Don't know if this has been covered on here before, and I apologize if it has. A search didn't show up anything on it.
I recently (OK a few months ago!) had a rear brake line rust through FROM THE INSIDE! Since brake fluid is hygroscopic, it absorbs moisture from the air, and then allows it to collect, usually at low spots in the line. Brake fluid does not move (much) in the lines. So the water sits there.
I was VERY lucky. I got back from a 250 mile road trip with two big blocks plus an old-style TH400 trans in the back of my 3/4 ton. Parked, went in the house. Next morning, when I went to move the truck the brake pedal went to the floor!
Rear line rusted through.
When I changed out the line I found another couple of places that looked good on the outside, but were getting awful thin from the inside out
A periodic flush with clean brake fluid would have kept the moisture at bay. The little bit that you use bleeding brakes may not be enough, so do a 100% system flush.
Bottom line - brake fluid is cheap compared to your ride or your life. Flush out the whole system every couple of years and we'll all live longer!