Encouraging oil and gas (O&G) companies to develop renewable energy sources (RESs) is crucial for China’s energy strategy and sustainable development. The transition from O&G energy to RESs is a complex and systemic process that requires a comprehensive analysis of both internal and external driving factors. This study integrates the theoretical dimensions of energy transition with the operational realities, utilizing structural equation modeling (SEM) to analyze these factors and their influence on the decision-making process for companies in this sector. A multi-group analysis was conducted to explore differences in motivational mechanisms among groups with varying levels of transition willingness. The findings reveal that environmental awareness, economic value estimation, knowledge accumulation, dynamic capabilities, structural overlap, and government actions significantly promote the energy transition, whereas resource endowment acts as a barrier. Moreover, the willingness to transform moderates the effects of government actions and pressures from other stakeholders on corporate environmental awareness and the transition to RESs. This article provides more comprehensive research perspectives on exploring the driving mechanisms behind the transition to renewable energy, emphasizing the importance of governments playing diverse roles based on the specific internal conditions and highlighting the long-term impact of other stakeholders on sustainable development.