Detonation arrestors function by providing a barrier that quenches the flame and absorbs the high-energy shock wave of a detonation. They typically consist of components such as flame arresting elements, shock attenuation chambers, and heat-absorbing materials. These elements work together to cool the flame below its auto-ignition temperature and dissipate the energy.