Compartmentalization is an unconscious psychological defense mechanism employed to avoid cognitive dissonance.