This is misconception I would request you to please read the political history of Afghanistan during 60s and 70s it was their own internal political turmoil which took ugly turn, Afghan socialist who had captured the government invited Soviet Union into Afghanistan.
Initially even factions with in Afghan socialist fought with each other then Soviet supported one factions of over the other, then common Afghan in villagers and religious faction initiated the resistance on lower scale. That was the beging of Afghan Jihad or first civil war.
Pakistan 'actively' enter into it after a year in late 1980 US came in support in think in 1982 or 1983.
Please keep context in mind.