What is the foam pad on the bottom of a large, through-hole capacitor for?
It is a rubber seal. It keeps the magic smoke in.  Or at least the electrolyte.  

From Nichicon tech data: 



Vishay tech data gives a better view of the seal: