This question is outside of my area of expertise, but I thought I would give it a go anyway since no one else has. Prior to the conflict, all three nations had recently fought together in the Chincha Islands War against Spain during the 1860’s, but as world demand grew for nitrates, the relationship between the nations deteriorated at the hands of disputed national borders. On paper, the two sides seemed evenly matched. Their navies were comparable. Chile’s army was smaller than Peru and Bolivia’s but slightly better equipped. Given the difficult geography of the region (the Atacama Desert, one of the driest in the world; the Andes, the high altitudes and rugged terrain) and limited infrastructure, the outcome of the war largely was decided on the seas. Here, according to Lawrence Sondhaus in Navies in Modern World History, Chile had a minor advantage with slightly newer ships. For much of the first year, the war was mostly a naval confrontation with Chile gradually gaining control of the sea, though not without significant losses. Eventually, Chile gained naval superiority by isolating and eliminating enemy vessels, which allowed them to land troops and supplies along Bolivia and Peru’s coast with ease. For the allies, this meant they had to march their armies and supply lines through the rugged inland territories. From here, Chile won a series of battles on land, which effectively depleted the allies of well trained soldiers (again, not without defeats). Chile systematically captured key cities along the coast, culminating with Lima. From here, the war dragged on, eventually turning into a guerrilla war. However, the outcome of the war at this point was clear; it was just a matter of working out the terms.
Outside of the successful execution of Chilean military strategy, there were a variety of underlying reasons that gave Chile an advantage. First, Chile was much more stable internally than Peru or Bolivia. Though Chile was beset by minor domestic conflicts during the middle of the 19th century, these pale in comparison to the frequent ousting of Peruvian and Bolivian leaders prior to and during the war. As a result of this instability, Chile had more developed political institutions, internal infrastructure, and leadership. More importantly, as demonstrated by Erica Beckman in “The Creolization of Imperial Reason: Chilean State Racism in the War of the Pacific,” stability also fostered a sense of identity among its people. They considered themselves whiter, more civilized, and more worthy of valuable territories. Though Eurocentric and racist, these sentiments demonstrated an “immensely self-confident” identity and affiliation with their nation, according J. Douglas Porteous in his article “The Annexation of Easter Island: Geopolitics and Environmental Perception” (p. 69). The allies lacked deep reserves of patriotism, and once casualties took their toll, Peru and Bolivia turned to poorly trained, conscripted soldiers.
William Sater identifies two other key reasons Chile won in his recent book Andean Tragedy: Fighting the War of the Pacific. First, he points to the geography of the combatants. Chile had an easier time supplying itself due to its access to international shipping lanes that rounded Tierra del Fuego. On the other hand, “Peru’s supply process not only was more complicated than Chile’s but it also depended upon the good will of the Colombian authorities to ship materiel across the Isthmus of Panama” (p. 354). Sater emphasizes however that in a war which seemed so evenly matched, it was Chile’s superior officers who ultimately decided it. He explains that “most naval officers attended the Escuela Naval; and more than a few served with foreign flotillas, including the vaunted Royal Navy...Conversely, on the Peruvian side, many of country’s naval officers, commanded literally by ancient mariners, lacked either any formal training or, thanks to the government’s penury and fear, sufficient practical experience” (p. 356). The same was true of Chilean officers on land, who gained experience in the military academy and fighting Native Americans in the south.
So hopefully this quick overview has answered your question. It’s interesting to me because, in general, modern wars seem to be so often decided by large underlying power disparities, devastating campaigns, or drastically superior strategy, but in the War of the Pacific, none of these are present. Instead, it was these relatively minor differences that tipped the balance for Chile.