Engines get their power from combustion, which is quite noisy, and a lot of that noise finds its way out of the engine through the exhaust. The muffler is designed to reduce the volume of the engine as much as possible, while not reducing the flow of the exhaust gasses.
High Performance Mufflers
Mufflers tend to be quite restrictive when it comes to flow, and whenever exhaust flow is slowed down, the engine has to use more of its power to push the exhaust fumes out, and that means less power available to move the vehicle forward. Performance mufflers free up flow to varying degrees. Typically, the less restrictive the muffler is, the louder the result, so the buyer will choose a muffler based on the application. Some exhaust systems use parallel dual mufflers, so the restrictions aren't as much of a hindrance to begin with. Some racing vehicles eliminate the muffler entirely, and active "muffler bypass" systems are available as well, which allows the driver to choose to dampen the sound by routing exhaust to the mufflers, or closing off that route while opening an immediate exhaust exit.
The sound of the muffled exhaust depends largely on the muffler and engine, but also can be changed by altering the rest of the exhaust before the muffler's location, as well as the exhaust tip. Having a turbo equipped can sometimes muffle the sound as well.