There is a broad theoretical and empirical interest in spontaneous mimicry, or the automatic reproduction of a model's behavior. Evidence shows that people mimic models they like, and that mimicry enhances liking for the mimic. Yet, there is no satisfactory account of this phenomenon, especially in terms of its functional significance. While affiliation is often cited as the driver of mimicry, we argue that mimicry is primarily driven by a learning process that helps to produce the appropriate bodily and emotional responses to relevant social situations. Because the learning process and the resulting knowledge is implicit, it cannot easily be rejected, criticized, revised, and employed by the learner in a deliberative or deceptive manner. We argue that these characteristics will lead individuals to preferentially mimic ingroup members, whose implicit information is worth incorporating. Conversely, mimicry of the wrong person is costly because individuals will internalize "bad habits," including emotional reactions and mannerisms indicating wrong group membership. This pattern of mimicry, in turn, means that observed mimicry is an honest signal of group affiliation. We propose that the preferences of models for the mimic stems from this true signal value. Further, just like facial expressions, mimicry communicates a genuine disposition when it is truly spontaneous. Consequently, perceivers are attuned to relevant cues such as appropriate timing, fidelity, and selectivity. Our account, while assuming no previously unknown biological endowments, also explains greater mimicry of powerful people, and why affiliation can be signaled by mimicry of seemingly inconsequential behaviors.