Mufflers are designed to use back pressure and noise bouncing off baffles to cancel out most of the noise from the cylinders firing and exhausting out the manifolds. There is a bit of a science to designing a muffler that will deaden the sound, yet allow decent flow to help with power and economy.
You're acting like there wouldn't be any noise generated from having many tiny explosions every second happen in an enclosed space. It's not like the explosion happens, and then it takes several seconds for anything else to happen. And i'm pretty sure if you put a small bomb inside a small building inside a mine shaft and set it off, you'd still hear it in just about every other area of that mine shaft even if the building is completely sealed. Doesn't really take mechanical engineering or physics to figure out why an engine makes a lot of noise.