This study delves into power system flexibility, with a keen focus on the integration of variable renewable electricity generation into power grids. Two scenarios were analyzed. The base scenario revealed an aging grid, insufficient generation capacity, frequent outages, and little renewable energy generation (1.9%), along with a significant (71.23%) loss of load. In contrast, the investment scenario presented solutions including raising VRE capacity to 44%, adding 1000 MW capacity transmission lines, installing 200 MW capacity grid-scale battery storage, and technological enhancements. These interventions effectively eliminated loss of load, reinforcing energy resilience. Investments in CCGPP and grid-scale batteries proved instrumental in mitigating the variability of renewable energy. Improved transmission promised efficient power exchange and regional collaboration. The elimination of annualized energy spills and the removal of ramping constraints marked significant strides in enhancing power system flexibility. This research underscores the pivotal role of grid flexibility in accommodating VRE sources. By implementing the proposed optimal solutions, Afghanistan can lead the way toward a cleaner, more resilient, and more interconnected energy future. These findings offer a replicable framework for addressing similar challenges in integrating renewable energy sources globally and supporting the transition to sustainable and reliable energy.