Knowledge sharing improves enterprise performance. Although many enterprises have adopted incentives that encourage employees to share knowledge, some employees still do not share professional knowledge. The influence of knowledge hiding is one of the main issues in the field of management research. To understand how self-efficacy affects team dynamics, we hypothesized (based on the Social Cognitive Theory) that knowledge hiding is associated with general self-efficacy and knowledge sharing self-efficacy; and that the influence of knowledge hiding is moderated by trust. This study enrolled 219 respondents from 5 Chinese cities to determine whether domain-specific self-efficacy influences knowledge hiding. The empirical results show that: (1) general self-efficacy has a significantly positive effect on knowledge sharing self-efficacy; (2) general self-efficacy has a significantly negative effect on knowledge hiding; (3) knowledge sharing self-efficacy has a significantly negative effect on knowledge hiding; (4) knowledge sharing self-efficacy plays a partial mediating role between general self-efficacy and knowledge hiding; (5) Trust negatively moderates the influence of general self-efficacy on knowledge hiding; (6) Trust negatively moderates the influence of knowledge sharing self-efficacy on knowledge hiding. Previous studies on knowledge hiding factors have focused on the (Western) principles of fairness and reciprocity and have not considered the situation in China. In this study, the localization knowledge hiding scale is used to explore the inhibitory effect of self-efficacy on knowledge hiding. Additionally, this study explains why it is more difficult to study knowledge hiding in China (as compared to Western countries). Western employees pay more attention to hiding strategies whereas Chinese employees pay more attention to hiding intentions because they are afraid to show their hidden intentions and affect interpersonal relations. This paper first discusses the moderating effect of trust on the relationship between self-efficacy and knowledge hiding, integrating individual traits, individual behaviors, and team atmosphere together. Next, by simultaneously studying general self-efficacy and knowledge sharing self-efficacy, this study helps understand the differences and similarities between the drivers of knowledge hiding by identifying both domain-specific characteristics of these influences and the similarities in how these influences play out in Chinese enterprises.