How did Chile get so long?
Summary
In summary, it boils down to Chile claiming land from Peru and Bolivia, and due to them not being on good terms, they fought, and the war ended in a Chilean victory, causing Peru and Bolivia to give up a ton of land and resources.

Where it happened
How'd it start?
The war started when Peru, Bolivia, and Chile claimed parts of the Atacama. Peru became super aggressive over the claims and increased tensions. Bolivia and Peru became allies, and Bolivia and Chile agreed with Chile that they would stop sending materials to Chile and they would not tax Chilean businesses. However, Bolivia began to tax the Chilean Antofagasta Nitrate Company and threatened they take their land. So Chilean forces invaded to stop it and Bolivia declared war.
During the war.
Chile then asked for help from Peru, but when they didn't, Chile declared war on Peru. Chile quickly occupied the coastal regions of Bolivia and they focused on Peru. Peru had a much stronger navy than the Chileans but Chile later on won many important naval battles and the Peruvian navy was crippled. They then launched a ground assault on Peru's capital and it was captured. Peru would keep fighting but would eventually surrender.

Result
What Chile received
Bolivia and Peru had to pay Chile lots of resources like copper and give a bunch of their land to Chile. In total, Chile got three territories but would return 1 to Peru in 1929.
