Prejudice is a major cause of in-groups as similar minded people, with alike prejudices, might join to form a clique. Some consider cliques to be a social norm, and to "fit in", they feel compelled to join one. Scapegoating a common tactic used by mobs to blame one, or a few individuals, even if there isn't sufficient evidence to prove guiltiness. Equal status contract explains why people form cliques and why they can act hostile to others, but not to people in their "group". Using attribution theory, one can model a situation to determine the causes of actions and behaviors.
The puppy no longer greetng Molly when she enters the house is an example of extinction. This is because the puppy lacks motivation to greet her when she enters the house because she does not have treats.