According to Sigmund Freud
Psychological projection or projection bias is a psychological defense mechanism where a person subconsciously denies his or her own attributes, thoughts, and emotions, which are then ascribed to the outside world, usually to other people. Thus, projection involves imagining or projecting the belief that others originate those feelings.
Projection reduces anxiety by allowing the expression of the unwanted unconscious impulses or desires without letting the conscious mind recognize them.
An example of this behavior might be blaming another for self failure. The mind may avoid the discomfort of consciously admitting personal faults by keeping those feelings unconscious, and by redirecting libidinal satisfaction by attaching, or "projecting," those same faults onto another person or object.
*hums who the cap fits*