Microgrids are extensively integrated into electrical systems due to their many technical, economic, and environmental advantages. However, they encounter a challenge as they experience high-frequency fluctuations caused by the stochastic nature of renewable energy generation, electric loads, and the presence of Electric Vehicles (EVs). Therefore, various techniques, algorithms, and controllers have been introduced to ensure effective Load Frequency Control (LFC) and maintain a stable power system in microgrids. These methods aim to ensure that the system's frequency remains stable and within an acceptable range, especially when faced with changing load demands and other factors. This paper presents a novel enhanced control approach, Particle Swarm Optimization-Trained Artificial Neural Network (PSO-TANN), to optimize the load frequency model of a microgrid with vehicle-to-grid integration. The results are then compared under various scenarios, including renewable energy integration, EV charging and discharging dynamics, and varying load demands. The comparative analysis involves assessing the performance of the conventional Proportional–Integral–Derivative (PID) controller, the PSO-PID controller, and the newly proposed controlling technique. The suggested controller attains 99.904% efficiency with a negligible mean squared error of 1.1112 × 10−7, decreasing the integrated time absolute error to 1.0 × 10−4. It shows rapid response, precise targeting, and quick peak output ability, with marginal overshoot and undershoot, and a transient time of 28.5626 s, efficiently controlling microgrid frequency. Stability analysis validates the effectiveness of the proposed PSO-TANN controller in ensuring stability within the microgrid's LFC system during uncertainties and disturbances. This establishes resilience, diminishes settling time, and maintains reliable performance while controlling frequency. • An investigation into an islanded microgrid's Load Frequency Control (LFC) model framework has been conducted, comprising diesel generator, solar PV system, wind turbine, and EVs operating in vehicle-to-grid mode to supply power to electric loads, consequently impacting the frequency dynamics of the microgrid system. • A novel enhanced control approach, Particle Swarm Optimization-Trained Artificial Neural Network (PSO-TANN) has been implemented to optimize the load frequency model of a microgrid. • An extensive comparative analysis with other controllers, including PID and PSO-PID, is conducted across diverse scenarios involving renewable energy integration and EV charging and discharging dynamics under various load disturbances to reduce settling time, control system frequency, and ensure reliable performance. • The stability analysis validates the efficiency of the proposed PSO-TANN controller in ensuring reliability during uncertainties and disturbances, maintaining overall robustness and stability of the LFC system within the microgrid. [ABSTRACT FROM AUTHOR]