There is an interesting phenomenon known to psychologists as projection. I quote at length from wiki’s entry on the topic.
Psychological projection was first conceptualized by Sigmund Freud as a defence mechanism in which a person unconsciously rejects his or her own unacceptable attributes by ascribing them to objects or persons in the outside world instead. Thus, projection involves projecting[clarification needed negative qualities onto others, and is a common psychological process. Theoretically, projection and the related projective identification reduces anxiety by allowing the unconscious expression of the unwanted unconscious impulses or desires through displacement.