how silencers works
When a cork pops out of a champagne bottle, a lid pops off an over-heated jar, or a bullet shoots from a gun; they all result in a sound. High pressure gas is released so suddenly that we can hear the waves of pressure it makes as the waves travels through the air.
Sparkling wine is bottled under pressure. Jars lids pop off because the air inside them heats and expands. A bullet explodes from a gun when gunpowder behind the bullet is ignited. It burns and releases gases violently and quickly. The bullet is the "lid," sitting between the gases and the easiest point of exit from the gun barrel, and so it shoots out into the air. The gas behind it crashes into the air, making the ‘bang' that most people associate with gunshots.
Silencers, or "suppressors," are all about finding ways to reduce the speed, volume, and temperature of that gas. They do so using various structures. One structure is just large chamber attached to the end of the gun barrel. This gives the expanding gas somewhere to expand into. It's a little foyer that some of the gas can mill around in, instead of shooting all of it out of the gun at once. Another is a series of small chambers, almost a honeycomb made of metal. The many chambers make the flow of gas choppy, interrupted by diversions. The honeycomb also makes the gas flow over a large, metal surface area. Metal absorbs heat very well. All the heat that goes into the metal comes out of the gas. Since heat makes gas expand, losing some heat will make it contract. That contraction means less pressure, and that means less of a bang.