To answer the perennial question of why Pakistan insists on having a say in the affairs of Pakistan, we have to look at the way Pakistan is situated. Afghanistan has never accepted the borders with Pakistan (made by a British official by the name of Durand hence called Durand Line), Pakistan is afraid that if the Afghans become stronger Pakistan's own restive North western Province where the majority of the ethnic Pashtuns live will want to join the Afghans thus threatening the very survival of Pakistan. Also Pakistan's perceived Number one Enemy India is trying to gain more influence in Afghanistan to the fear of the Pakistan Military that they may be trapped by two hostile Neighbors Afghanistan and India with Iran. Well long story short, Pakistan wants to keep a friendly government in Afghanistan so that it can have only one perceived enemy and not two.
Another small nation interests playing out is with Iran and Saudi Arabia both with opposite branches of Islam. Although both believe in the same faith (with slight variations) but both want to contain each other influences and thus draw in big powers like what is happening in Afghanistan. The Russians although the former Soviet Union has disintegrated still wants to retain influence in the former Soviet colonies. Egypt wants to have influence in the Arab Countries but is hampered by lack of cash to make that work and so we can go to Turkey, Greece, France and list goes on and on and we don’t even know some countries whose interest maybe more subtle than others. So in this crazy world, interests are constantly being defined and modified according to the circumstances and situations.