This is a great question. There were several factors, which lead to the dissolution of the Soviet Union. Generally speaking, we can say that there were internal and external problems, which caused great dissatisfaction among the people.
First, the Soviet Union's economy was not doing well. They spent so much money during the cold war on their military development that they did not build up their economy on other areas. For this reason the average citizen was poor and dissatisfied. What made this worse was that their foe, the United States, was doing much better.
Second, there was a lot of internal strife among politicians. For example in the 1980s there was a quick succession of leadership. Yuri Andropov and Konstantine Chernenko were in power less than two years, before Mikhail Gorbachev came into power.
Third, the war efforts in Afghanistan was prolonged (nine years) and unpopular. You can imagine what the citizens of the Soviet Union were thinking. Think of our efforts in the Middle East now.
Finally, the United States persuaded Saudi Arabia to produce more oil to bring the price down, so that the Soviet Union would not make a profit on one of their chief exports.
All of this lead to the demise of the Soviet Union.