The initial spark was ignited by the government's decision to abolish the fuel subsidy. The situation quickly escalated, overshadowing even the Venezuelan crisis, as indigenous people, students, the lower classes and labour unions joined the protests against the Neo-liberal policies enforced by the government, while president Lenin Moreno even deployed the army, in a desperate effort to restore public order. These measures failed dismally, however, as the rioters managed to gain control of Carondelet Palace and many other locations in the capital, including TV channels, forcing the government to flee to the relatively safer city of Guayaquil, in the Ecuadorian coast. Moreno has stated that he's never going to resign and that the uprising is nothing more than vandalism, caused by nefarious conspirators, which he will eventually quell.
For the general background, Moreno's predecessor, Rafael Correa, belonged to the group of leftist populists that ruled over several Latin American countries, which were previously under the sphere of influence of the United States and conservative financial policies. Despite his controversial and somewhat authoritarian tactics (albeit he was democratically elected to the office), Rafael Correa has been credited with a remarkable reduction in poverty and a substantial increase of the Ecuadorian people's quality of life. He favoured state centralisation and implemented several modernising reforms, significantly reinforcing the welfare, education and healthcare systems. His foreign policy was not friendly towards Washington, while he also cooperated with Hugo Chavez and Bolivia. He left the office in 2017, when his second term expired (the Constitution forbids three or four consecutive terms), to be succeeded by his lieutenant and incumbent president, Lenin Moreno, who was expected to follow the path of his mentor.
Surprisingly, however, Moreno completely reversed the policy of his party, endorsing Neo-liberalism, curtailing social security and ditching the Bolivarian Alliance, for the benefit of America. Assange getting expelled from the Ecuadorian embassy in London was an example of his rapprochement with America and the condemnation of Correa's legacy, who now essentially lives in exile. Consequently, although he found many friends in individuals previously alienated with Correa, Moreno has totally frustrated the progressive wing of the party, while obviously endorsement of austerity and private investment has caused popular anger of apparently unmanageable dimensions.
In my opinion, the root for his "backstabbing" is his attempt to gain absolute power over the government and the party, despite previously being only a relatively obscure underling of Correa. Correa presumably planned to circumvent the Constitutional prohibitions, by installing a reliable puppet to the presidency, similar to how Putin collaborated with Medvedev in Russia. However, the scheme backfired and it was Moreno who actually manipulated Correa. Ηis romance with the US and more conservative elements in Ecuador is probably a classical case of siding with my opponent's enemies, an effort to create an independent base of support among "centrists", in order to counter-balance the still strong power of Correa and the radical faction inside Ecuador. It was a reasonable and slightly Machiavellian strategy, but his reactionary doctrine was far from flawless, as his retreat from Quito amply demonstrates. Unless he quickly succeeds in smashing the protests and regaining the control of the capital, his only option will be to quit the country and the presidency.