Abstract Observations indicate that early-type galaxies exhibit varying slopes in the relation between their central stellar surface density and stellar mass (Σ 1 – M ⋆ ). Low-mass galaxies tend to follow a steep slope, close to 1, while the slope flattens for high-mass early-type galaxies. In our study, we investigate the Σ 1 – M ⋆ scaling relation and its evolution using the Numerical Investigation of Hundred Astrophysical Objects (NIHAO) suite of cosmological simulations and compare our findings with recent results from the MaNGA survey. Our analysis shows that NIHAO galaxies successfully reproduce the observed scaling relation based on the MaNGA survey. Our analysis suggests that active galactic nucleus (AGN) feedback plays a critical role in flattening the Σ 1 slope, by expelling gas from galactic centers, leading to a decrease in both stellar and dark matter density as the gravitational potential becomes shallower. To further support our findings, we conduct high-resolution N -body simulations, which confirm that (sudden) gas removal does substantially alter the stellar density in the central region, consistent with the results from NIHAO. Furthermore, our numerical experiments show that even if the same amount of gas is reaccreted on a typical (longer) freefall time, it is not able to restore the original stellar density. Our study concludes that AGN-feedback-assisted gas removal presents a plausible explanation for the decline in central stellar surface density as observed in massive elliptical galaxies.