Why did the the War of the Triple Alliance (Brazil, Argentina, and Uruguay against Paraguay) happen?
Paraguay, unlike Uruguay, had a thriving economy at the time. This called to the attention of Brazil and Argentina, who wanted to keep the economic dominance of the La Plata River for themselves. Aside from this, ships which wanted to arrive at Cuiabá (capital of Mato Grosso, Brazil) had to travel through Paraguayan territory because there was no inland access. And Paraguayan government began to make the travel difficult.
Things became tougher when, in April 1864, Brazilian minister José Antônio Saraiva arrived at Uruguay to demand payment for damages caused to Brazilian border farmers during the Cruzada Libertadora, an invasion led by Gen. Venancio Flores to take Uruguayan government for himself.
As it happens, Venancio Flores was an ally to Solano Lopez, President of Paraguay. Flores denied any payment, made demands himself and asked Paraguay for help. Lopez offered to mediate the conflict, but Brazil denied and insisted on their demands. Paraguay sent an ultimatum, declaring that any occupation on Uruguay would be understood as an act of war against Paraguay as well. Brazil dismissed the threat as only diplomatic and invaded Uruguay on October 12, 1864.
On November 12, 1864 Paraguay retaliated by kidnapping the Brazilian ship Marquês de Olinda, which sailed up the Paraguay River in order to arrive at Mato Grosso while the province’s President was on board. Paraguay declared war on Brazil the next day.
Paraguay had a good expectation on winning the conflict because they were manufacturing weapons and forming a strong army since the end of 1863, when Argentina intervened in the invasion of Uruguay by Venancio Flores.
However, England also saw Paraguayan economic ascension as a big threat to its own imperialism in the region. If Paraguay developed a stronger industry, England would lose their entire market in South America. The Bank of England was also jealous that Paraguay had no external debt. Therefore they signed a secret (mutual defense) treaty with Brazil, Argentina, and the puppet government that Brazil had installed in Uruguay. England then encouraged Argentina and Uruguay to attack Paraguay with all their might while financing the war.
By the end of the conflict, Conde D’eu, who wanted to prove himself a fair general after failing at providing an heir to Brazilian crown (he was married to the emperor’s daughter), promoted a slaughter of gigantic proportions in the Paraguayan territory.
This lasted even after Solano Lopez was killed and is considered one of the worst war crimes in the world and certainly the worst in South America.
But the defeat and loss of incipient industries and land were not enough, the problem was that Paraguay lost 90% of its male population. 9 of each 10 Paraguayan men over 14 years old were killed.
If you are interested in more information about the war of the triple alliance here is an Economist article offering more detail