Probing the Difficulty Perception Mechanism of Large Language Models