Afghanistan's common people became homeless due to previous wars with the SU. The cold war ended up being a Vietnam war that exhausted soviet forces and economy.
The US noticed Afghanistan in 1973 when a government overthrow put a communist regime in power in Kabul. SU sent troops to Afghanistan and the US sent troops to the rebels. The communist government collapsed and the rebels took power. Taliban used US weapons against their own people and the US, itself.
After negotiations , the SU withdrew troops as long as the US stopped sending aid. The soviet supplied government was still fighting the American supplied rebels. US and PAkistan tried to stop fighting but nothing worked very well.
Very few large cities were left unharmed from military invasions. There were also specific territories controlled by Soviet forces during war.
The Soviet desire to spread communism and the fear of communism in the US led to the decay of Afghanistan. Afghan culture became melancholic. After the US and SU left the mess was left in Afghanistan. They had no real government.