Because they are worst affected by this tension.
Proximity with Iran means if ground troops get mobilised against Iran, then Israel would have presence via US in Iran.
Second, Further escalation risks Saudi Arabia going on offense and then Pakistan has to side with Saudi against Iran. This would strain relationship with Iran. And, if they don't act along Saudi, then it would strain relationship with Gulf especially with Saudi due to their defense agreement.
Third, there's massive fuel prices spike there. Within first week of war, prices were raised. During fourth week, prices were raised again. When fuel gets so expensive, then every single damn thing gets expensive as transportation costs increase. All these costs are pass down to consumers and it leads to inflation, less demand,. decline in production, lack of jobs and increase in unemployment and thus recession.
Pakistan simply can't afford for war to go on or escalate any further. It's better to do something about this and try to mediate than simply sit on fence and feel the heat of it