In the era of digital economy, global enterprises are facing unprecedented transformation pressure and development opportunities. Traditional business models are under impact, and enterprises must reexamine their value creation methods and competitive strategies. Based on the data of A-share listed companies from 2013 to 2022, this paper constructs a mediated adjustment model to explore in depth the impact mechanism of digital transformation on the performance of high-tech enterprises. The study adopts the least squares estimation method and two-way fixed effects model, takes ROE as the corporate performance measure, constructs digital transformation indicators through text analysis method, uses CSI ESG rating as the mediator variable, and business environment as the regulator variable for empirical analysis. It is found that digital transformation significantly improves enterprise performance, with a regression coefficient of 0.003 and significant at the 1% level; ESG performance plays a partial mediating effect in the relationship between digital transformation and firm performance, with a mediation effect coefficient of 0.015 and significant at the 1% level; Good business environment strengthens the performance improvement effect of digital transformation, with a moderating effect coefficient of 0.015 and significant at the 1% level; heterogeneity analysis shows that the effect of digital transformation is more significant in state-owned enterprises, with a regression coefficient of 0.0085. This study confirms that digital transformation improves the performance of enterprises by enhancing the performance of ESG, providing empirical evidence for the formulation of digital strategies by enterprises and optimization of business environment by the government. It provides empirical evidence for enterprises to formulate digital strategies and the government to optimize the business environment.