My guess is it does two things, the foam acts like a gasket helping to direct more air thru the radiator for greater efficiency & acting as anti vibration/sound damping. And, as an unfortunate consequence, retains moisture.
I believe they are for forcing as much air through the radiator as possible when in high load conditions, moving on the road. Stuck in traffic with the hydraulic fan drive thing* on full blast too. (*The 1980’s gizom connected to the fan)
I took the bottom portion off last week during an oil change. The sticky tape is the hardest part. I Fluid Film’ed the support it was stuck to. No rust was found. There is a right and a left part that I will remove next time. I Fluid Film’ed them.
__________________
2020 4Runner SR5 Premium 4x4
Barcelona Red, Graphite/Grey
Sunroof