Corrosion on top of a battery is usually caused by the battery itself leaking acid through a seal and around the post. The corrosion could also have built up due to a bad connection.
You should clean up the corrosion. If it comes right back, it is time to replace the battery. Be very careful when handling a corroded battery and take preventive measures. Wear latex or latex-free gloves and safety glasses.