By integrating the behavioral theory of firms with institutional theory, this study examines the causal impact of environmental legislation on corporate ESG performance through a quasi‐natural experiment involving the implementation of the China's New Environmental Protection Law (NEPL). Utilizing data on Chinese listed companies from 2010 to 2021 and employing a difference‐in‐differences model, our findings reveal that the NEPL significantly boosts ESG performance, with improvements increasing over time. Our mechanism analysis indicates that this enhancement is primarily driven by the improved quality of environmental information disclosure, suggesting proactive disclosure under stringent environmental legislation. Further heterogeneity analysis reveals complementary effects from private attribute, institutional shareholdings, and public media attention. This paper opens the “black box” of how environmental legislation influences corporate ESG performance from the perspective of strategic company disclosure, highlighting the critical role of proactive information disclosure in navigating complex external environments.