Efficient control of fluid mixing and heat transport is a major challenge in modern thermal engineering systems, including electronic cooling devices, heat exchangers, thermal energy storage units, and industrial processing equipment. In lid-driven cavities, vortex formation plays a fundamental role in improving convective heat transfer by enhancing fluid circulation and promoting thermal mixing between hot and cold regions. The introduction of localized magnetic fields provides an additional mechanism for controlling these vortical structures through Lorentz-force-driven flow modification. In electrically conducting hybrid nanofluids, the interaction between the magnetic field and fluid motion can significantly alter vortex dynamics, leading to enhanced thermal transport and improved heat transfer performance. Motivated by these practical and scientific considerations, the present study numerically investigates the influence of localized magnetic fields on vortex formation and heat transfer enhancement inside a two-dimensional lid-driven cavity filled with Ag–Fe۳O۴/water hybrid nanofluid. The governing equations are transformed into dimensionless form using the stream–vorticity formulation and solved through the Alternating Direction Implicit (ADI) scheme. The effects of the magnetic interaction parameter (Mn), Reynolds number (Re), magnetic strip width (L), and nanoparticle volume fractions on streamline structures, isotherms, skin friction coefficient, and Nusselt number are examined. The results reveal that localized magnetic fields significantly modify vortex dynamics and thermal transport within the cavity. Increasing the magnetic interaction parameter strengthens Lorentz-force-induced recirculation zones and improves thermal mixing near the magnetic strips. The Reynolds number considerably enhances convective heat transfer, while the magnetic strip width strongly influences vortex interaction and heat transfer enhancement. The average Nusselt number efficiency increases by approximately ۳۵۴% with increasing Reynolds number and by about ۳۰% for optimized magnetic strip width. Furthermore, increasing nanoparticle concentration substantially improves the thermal performance of the hybrid nanofluid. The findings demonstrate that localized magnetic fields provide an effective mechanism for controlling vortex structures and enhancing heat transfer in hybrid nanofluid-filled enclosures.