An excellent overview of the early 19th century background, excerpted from “Indigenous Peoples and State Formation in Modern Ecuador” by Clark and Becker:
Ecuador is composed of four zones: the tropical Pacific coastal lowlands, the temperate Sierra highlands, the eastern upper Amazon basin, often called the Oriente, and the Galápagos archipelago 780 kilometers west of the mainland. These geographic divisions obscure even deeper and more persistent political and cultural divisions. Historically, these were manifested in the highland capital, Quito, which declared its independence from Spain in 1809 in an action separate from the coastal port of Guayaquil, which proclaimed its independence in 1820. When Spanish forces were defeated outside Quito at the Battle of Pichincha on May 24, 1822, Quiteños watched while foreigners and Guayaquileños fought under the leadership of Antonio José de Sucre. When Ecuador separated from Gran Colombia in 1830, its constitution defined the new country as a weak federation of Guayas on the coast, Azuay in the southern highlands, and Quito in the northern highlands. Three decades later, this regionalism had clearly not been overcome. The country was nearly dissolved as four governments claimed to rule the national territory from the highland capital of Quito, from the port of Guayaquil, and from the two southern cities of Cuenca and Loja.
–from Clark,A.Kim and Becker,M. in Ch. 1: “Highland Indians and the State in Modern Ecuador” (pub. 2007) p.7