ESG (environmental, social, and corporate governance) is a crucial initiative for achieving the long-term objectives of the second century. It is a vital requirement for advancing sustainable development and achieving the dual-carbon objective. Additionally, ESG serves as a significant catalyst for transforming and upgrading the economic structure, as well as promoting the development of the national economy. This study utilizes data from 14,873 enterprises listed in Shanghai and Shenzhen A-shares between 2017 and 2022 to uncover the role of ESG on corporate value. The analysis employs a double fixed-effects model with a specific focus on the corporate value perspective. The findings indicate that the performance of ESG factors can enhance the overall value of a corporation and multiple rigorous tests have been conducted to validate this discovery. Enhancing ESG performance improves the value of a company by fostering innovation in both ecological and sustainable practices. Moreover, dual green innovation mediates relationship between ESG and firm value, with exploratory green innovation playing a more prominent role. Firms in decline have the greatest ESG influence in terms of the heterogeneity in ESG's ability to increase firm value. During the decline phase, green innovation pioneering plays a crucial role, while exploitative innovation during the maturity phase has the most substantial effect on these companies.