The evolution of psychodynamic mechanisms