As a new construction method, prefabricated buildings have many benefits. The majority of owners and contractors still work together using conventional approaches at the moment. However, the standardization and batch production of prefabricated components are challenging to achieve using these methods. Furthermore, they prevent economies of scale from being realized. A thorough examination of the developmental dynamics of the cooperative relationship between prefabricated building owners and contractors is necessary to support the high-quality expansion of the prefabricated building industry. This paper presents an evolutionary game model that analyses the cooperation relationship between the owner and the contractor of a prefabricated building. Following this, the model is numerically simulated with an emphasis on key variables, such as excess benefits, transaction costs, and the decrease in risk costs. The results indicate that the excess benefit factor positively influences the system's evolution toward strategic cooperation. Additionally, establishing an appropriate partition coefficient of excess benefit can effectively enhance strategic cooperation between the two parties. The presence of transaction costs in collaboration between owners and contractors hinders the system's progression toward strategic cooperation. Appropriately allocating transaction expenses can improve the parties' strategic cooperation. The reduction in risk costs has a favorable impact on the system's evolution toward strategic cooperation. With the goal to maximize strategic cooperation, there is also an ideal partition coefficient for risk cost reduction. The issue of inadequate risk cost consideration in previous research is successfully resolved with the model proposed in this work. The research findings hold significant value in guiding the formulation of incentive measures, optimizing profit distribution mechanisms, and enhancing the cooperative environment within enterprises.