What's the purpose for the foam rubber liner under the headliner?

The headliner in my 59 VW was just vinyl with the wire bows to hold it up when I replaced it. I think this was pretty standard back then-no foam, just the sewn material. But using a Styrofoam shell with the foam headliner glued to it just makes a nice finished product, and no sewing required.