This study aims to examine and compare the mechanisms through which social learning processes influence the knowledge contribution behavior of lurkers and contributors in open innovation communities (OICs). Based on social learning theory and stimulus–organism–response (SOR) framework, this study developed a model of knowledge contribution formation mechanism from environmental stimuli (observational learning, reinforcement learning), organism cognition (self-efficacy, outcome expectancy) to behavioral response (initial contribution, continuous contribution). The model was tested using structural equation modeling based on a dataset collected through a questionnaire from an OIC of business intelligence and analytics software. The empirical results showed that, at the initial participation stage, observational learning had a significant effect on the organism’s cognition of the lurkers, and indirectly influenced the initial knowledge contribution behavior through self-efficacy and outcome expectancy. At the continuous participation stage, observational learning had a significantly lower impact on the organism’s cognition of contributors and only indirectly influenced continuous knowledge contribution behavior through outcome expectancy. In contrast, reinforcement learning influenced the organism’s cognition of contributors and partially influenced their continuous knowledge contribution behavior through the mediating effects of self-efficacy and outcome expectancy. However, self-efficacy had a more pronounced effect on contributors’ continuous knowledge contribution behavior than outcome expectancy. These findings provide practical guidance for the management of OICs to reduce knowledge contributor attrition and induce lurkers to evolve into knowledge contributors for sustainable community development.