HEPA filters work by trapping particles through various mechanisms including impaction, interception, and diffusion. Larger particles are captured through impaction, medium-sized particles through interception, and smaller particles through diffusion, which is influenced by the Brownian motion of nanoparticles.