As an important means for enterprises to acquire technological resources, the impact of mergers and acquisitions on technological innovation and underlying mechanisms deserve in-depth study. Using the merger and acquisition data of A-share listed Chinese companies from 2007 to 2020 in Shanghai and Shenzhen, the causal effects and influence mechanisms between mergers and acquisitions and technological innovation are identified and tested using the Difference-in-Differences method. The study finds that mergers and acquisitions have a long-term, sustained, technological innovation-enhancing effect on firms. Mechanism tests show that mergers and acquisitions can promote the technological innovation of enterprises by improving production efficiency, enriching digital knowledge, and enhancing market power. A heterogeneity analysis shows that the effect of mergers and acquisitions in enhancing technological innovation is more significant when the mergers and acquisitions meet domestic merger and acquisition requirements, when there is a small transaction size, and when the enterprises involved in the mergers and acquisitions are not state-owned. It is suggested that enterprises and the government should use multiple measures, while considering the impact of heterogeneity, to take full advantage of the positive effects of mergers and acquisitions on technological innovation.