In electrical distribution networks, inefficiencies and instabilities often arise from inductive loads like motors and transformers, which exhibit a lagging power factor. This reduces system capacity, increases losses, and can lead to lower voltage levels. To address these issues, integrating parallel capacitors proves effective, enhancing the power factor, improving voltage profiles, and reducing overall system losses and costs. This research explores the optimal placement of parallel capacitors within a distribution network to manage reactive power effectively, thereby minimizing losses and improving voltage stability and system efficiency. Utilizing DigSILENT Power Factory and MATLAB, a genetic algorithm optimizes the location and sizing of capacitors in a 33-bus distribution network, considering scenarios with and without distributed generation (DG) and the impact of harmonic currents. The study finds that incorrect sizing or placement of capacitors can worsen voltage deviations when higher harmonic levels are present. However, the optimization method accurately determines the best parameters for capacitor installation, ensuring compliance with voltage and harmonic constraints. Deploying more than three to four capacitors does not significantly affect outcomes, while a single busbar capacitor often fails to meet operational standards. In conclusion, strategic capacitor placement and sizing can significantly reduce losses, enhance voltage stability, and mitigate inefficiencies caused by inductive loads. Attention to harmonics is crucial to avoid negative impacts on the network. This approach offers a replicable framework for similar optimizations in other distribution systems, advancing smart grid technology implementation.