Foam is wrapped around the hard structural center of the mattress. This layer serves some structural purposes but is mostly geared toward making the mattress comfortable.
Polyurethane foam is produced from polyol and isocyanide. The substance is less expensive to produce, but is not as durable. Because of its chemical composition, it produces toxic gases if exposed to flames.
Latex foam is produced from tree sap. The substance is more durable than polyurethane foam, but more expensive. When exposed to flame, latex foam produces a smoke containing unburned carbon.