Originally it would have been closed cell foam, but over time and especially with freeze/thaw cycles, it will break down and hold increasing amounts of water. It doesn't soak it up like full on open cell foam like a kitchen sponge - it's more like a ripe apple when it's totally saturated. But that takes a long time. In between, you get a lot of flotation.
I just stripped about half the foam out of a 20' Double Eagle that spent a lot of the last 30 years in commercial service...total weight of the foam I took out was around 100 lbs, I'd say. And it had a pretty nasty hole in the sole that had been there for years.
The worst foam, closest to the keel, had water dripping out of it when you picked it up. But it was still maybe 1/3 the density of water, so it would have bobbed like a cork even then.
I'm replacing the foam because it's cheap (8 cubic feet is a couple hundred bucks) and while I don't expect it to keep my boat afloat per se, I think it allows a bit of a margin for error if things go wrong. I mean there's a pretty good argument that if you're swamping a 20' Double Eagle, nothing is going to save you...but I think if I ran over an unmarked object and tore a two foot gash in the hull and it was foamed up with dry foam, I bet I'd have a lot more time before I took on enough water for it to go seriously wrong. The foam would physically displace water that would otherwise enter.
So that's my take - it's closed cell foam but it breaks down over time but even so...hours and hours of submersion would be necessary to force even old foam to take on so much water that it had neutral buoyancy. If you have just a sealed air pocket, that's theoretically better, unless it gets an underwater hole punched in it and ships a bunch of water, at which point you could have 200 lbs in one corner in two minutes. Automatic disaster? No, but personally I like the delay that a foam-filled hull offers.