Open-cell foam has a porous structure that allows sound waves to enter. It is mainly used to absorb reflected sound.
Closed-cell foam contains sealed air pockets. It resists moisture, reduces contact between hard surfaces and works as a decoupling layer.
Open-cell foam is generally better for absorption. Closed-cell foam is better for moisture resistance, insulation and reducing rattles.