When Truth Is Overridden: Uncovering the Internal Origins of Sycophancy in Large Language Models