OK, this is going to be the very simplified version.
Yes, the whole point of using bungs is the effect it has on the driver(s) in the ported enclosure.
Proper bungs use open-cell foam, so they don't block the port tube completely, but rather impede the flow of air in it.
The result is a slight stiffening-up of the movement of the driver, due to the fact the damping effect of the air in the cabinet is increased now it can't move in and out so easily behind the driver.
Blocking the port completely will of course create a sealed box, which could over-damp the drive unit and cause a drastic loss of bass.
And for all the comedy about rolling of socks, the nature of the bung used can make a big difference. So one sock loosely rolled will have less effect than two rolled tightly and thus more efficiently blocking the tube.
If you want to get really geeky about this, try buying a big catering box of old-fashioned drinking straws, and using a bundle of these to fill the port tube. It will have a more subtle damping effect than foam bungs. Or indeed socks.
Consulting Editor, What Hi-Fi? Sound and Vision / whathifi.com
Audio Editor, Gramophone