Understanding the science of what’s going on can help us counteract these self-sabotaging tendencies.