A muffler (or silencer in British English) is a device for reducing the amount of noise emitted by a machine. On internal combustion engines, the engine exhaust blows out through the muffler. The internal combustion engine muffler or silencer was developed in parallel with the firearm suppressor by Hiram Percy Maxim.
Mufflers are typically installed along the exhaust pipe as part of the exhaust system of an internal combustion engine (of a vehicle, or stationary) to reduce its exhaust noise. The muffler accomplishes this with a resonating chamber, which is specifically tuned to cause destructive interference, where opposite sound waves cancel each other out.
Catalytic converters also often have a muffling effect. The effect is mainly generated largely by restriction, rather than by cancellation.
Motorcycle enthusiasts sometimes use the term "raygun," or "pea-shooter" for the old shape of motorcycle exhaust silencer/muffler with a long straight cylindrical barrel that merged roundedly at each end into the pipe, as in this image and this image