In this paper, the simultaneous optimization of capacitors and DSTATCOM in the radial distribution system is performed for minimizing the cost of network active losses along with the cost of installation and investment of reactive power, considering the reliability of compensators and incorporating the network load uncertainty. The decision variables include the installation location and the capacity of compensators, which is defined by a novel meta-heuristic algorithm termed the improved exponential distribution optimizer (IEDO). The conventional exponential distribution optimizer (EDO) is inspired by exponential distribution theory, which uses the spiral motion strategy in the EDO to improve optimization performance and prevent it from getting trapped in local optima. Simulation scenarios are implemented in three cases: I) capacitor optimization, II) DSTATCOM optimization, and III) simultaneous optimization of capacitor and DSTATCOM in the network without (scenario I) and considering the compensator's reliability and also the load uncertainty using the unscented transformation (scenario II). The simulation results of IEDO showed that Case III has the best performance by achieving the lowest cost, the highest percentage of net savings, and the most favorable voltage profile in comparison to other scenarios. The superiority of the IEDO has also been confirmed in contrast to widely recognized optimization methodologies. In addition, the results of Scenario II are clear: the system cost has increased by 8.76%, 8.79%, and 8.72%, and the net savings have decreased to 6.48%, 6.62%, and 6.42%, compared to Scenario I for cases I–III, respectively.