At its core, magnetic confinement leverages the Lorentz force, which acts on a charged particle moving within a magnetic field. The force is perpendicular to both the particle's velocity and the magnetic field direction, causing the particle to follow a curved path. By designing the magnetic field appropriately, particles can be confined effectively. This principle is used in devices like tokamaks for nuclear fusion and MRI machines.