I've always had a soft spot for this war in so much as the concept of Paraguay versus most of the rest of South America seems like a conflict too odd to ever have happened. How did it actually happen and did Paraguay, upon realising they'd gotten themselves into a war with all of their neighbours actually carry on fighting?
In 1862, Francisco Solano Lopez inherited a strong, united, and prosperous Paraguay from his father. Up until this point, Paraguay had not had very positive relations with Brazil and (to a lesser extent) Argentina. Stable relations with Uruguay were typically necessary for Paraguay given its landlocked position. Some argue that F.S. Lopez had some expansionist intents, but that is not the entire story. Lopez had friendly ties with the ruling Blanco Party in Uruguay, while the opposition to that party within Uruguay allied itself with Brazil and Argentina. Uruguay's politics became increasingly unstable during this period, and violence was affecting Brazil's border with Uruguay. Brazil was naturally in a position to do something, and gave what amounted to an ultimatum to the Uruguayan leadership (keep in mind the standing leaders at this point were not friends with Brazil, but their opposition was), and Uruguay declined Brazil's demands, so Brazil invaded under the pretense that they would be a 'peacekeeping force' to restore stability and order to the country, and the opposition to the Blanco Party in Uruguay, with the blessing of the Argentinians, joined Brazil's ranks. Paraguay, who was allied with Uruguay's leadership and inherently distrustful of Brazil, suspected that Brazil was trying to impose its will on Uruguayan politics, which would mean Paraguay would be diplomatically (and economically) isolated within the region, which would be damaging because of its landlocked position. So, predictably, Paraguay declared war on Brazil in 1864 in support of the Blanco regime, which they declared the legitimate rulers of Uruguay. Argentina was initially neutral, but Paraguay did not see it this way. Argentina maintained favorable trade relations with Brazil, gave the Uruguayan opposition its blessing (acknowledged it as a legitimate opposition party to vie for power), and would not allow Paraguayan troops to pass through its territory for military or logistical purposes. So from Paraguay's perspective, Argentina was just as much against them as Brazil, and subsequently declared war on them as well. One thing that is important at this point is that, by this point in the conflict, Paraguay had the more powerful (in numbers and training) military than the 'triple alliance', as it became known (remember, Lopez inherited a very strong and prosperous country, much unlike the Paraguay we are familiar with today). Paraguay had good reason to believe it stood a chance against all three forces. When faced with these odds, Argentina, The Colorado Party (opposition party) of Uruguay, and Brazil formed the Treaty of the Triple Alliance in 1865 for the sake of consolidating their forces against Paraguay, and leadership was given to the Argentinian President.
I won't go into too much detail about the military progression of the war, but Paraguay struck first, and was victorious over (mainly Brazilian) forces for the initial outbreak of the war, but the Triple Alliance eventually gained control of the Rio Paraguay, which cut Paraguay off from the sea. They eventually captured the Paraguayan Capital, Asuncion, as well. These crucial turning points were largely because of the superior tactics of the Triple Alliance (their armies were consolidated under one leadership). Lopez, at this point, realized defeat and was prepared to negotiate a peace treaty. The Triple Alliance, however, would not sign a treaty unless all of their terms were met (their terms were originally outlined in the Treaty of the Triple Alliance, so Brazil, Uruguay, and Argentina would not agree to any peace unless their terms for victory in the Treaty of the Triple Alliance were met). One of these terms called for the abolition of the Paraguayan State (which, to Lopez, meant his own death). So when Lopez met with the Triple Alliance to negotiate peace, one term that the Triple Alliance refused to drop was that Lopez must be deposed, and they would not stop attacking and occupying Paraguay until this happened. Naturally, negotiations quickly crumbled and Lopez was in a position to fight to the death to 1.) retake his capital and borders, 2.) re-establish the Paraguayan State and 3.) make sure the Triple alliance stopped attacking him if he were to get to such a point. Talk about a turning of the tables! The last few battles were bad losses for the Paraguayans and the end result was the death of Lopez and a Triple Alliance victory. One wonders what would have happened if Brazil Uruguay's Colorado Party, and Brazil did not consolidate their forces under a single leadership, but that's neither here nor there.
I'll be honest, Wikipedia's article on this was my main source, but I do find this as interesting as you!
Edit: I confused Uruguay with Paraguay, which was probably unavoidable.