Update and Question bout my battery

A little while back I posted asking about my battery/alternator because the car wasn't starting. There was a bunch of corrosion all over the battery and it turns out that's what it was. The car runs fine now, thankfully, but I was wondering if there is anything in particular that would cause that biuldup of corrosion? It was really bad, you couldn't even see the positive and negative terminals. Thanks!
 
The corroision is a natural occurance, can't remember exactly the chemical reaction that causes it at the moment. Years ago I bought a small can of aerosol battery terminal dressing. I've found that if you clean up the connections well, put everything back together tight and spray a little of this stuff on the terminals (the brand I have is red) you'll never have to touch it again. I use it on my RV too as the batteries in the 5th wheel will corrode at the connections pretty quickly. I've been using the same can for about 10 years, a little goes a long way.