>>212108876It happened in stages. The Spanish wiped out the natives of Uruguay and the immediate area of Buenos Aires because they couldn't be reasoned with. In fact Buenos Aires had to be founded twice because all the original Spanish settlers were wiped out and eaten by the natives. So the Spanish had to be aggressive to settle the area.
Then the frontier gradually expanded south, but the Spanish were never really interested in Argentina so most of it was left largely unsettled. The only reason they cared about it at all was to establish a route to the Atlantic to export silver from Peru and Bolivia, so they founded a string of cities from Bolivia to Buenos Aires, but even then it was a secondary route for the silver exports, most of the silver kept being exported from Peru in the Pacific. Main export of colonial Rio de la Plata was cow hides and leather, which tells you how irrelevant the area was. The colonial population was very small and basically a backwater.
Then in the 19th century the steamer ships were invented and these allowed exports of refrigerated beef and wheat to Europe, and that's what made the area economically interesting for European settlers so the large scale immigration begun, after the country was already independent. The new settlers outnumbered the original colonial population like 14 to 1. They begun pushing the frontier southwards in slow phases, forts would be built but native raids were a constant headache.
Finally in 1880 the government panicked because Chile was extending its own frontier southwards so they feared they would take Patagonia or another foreign power would set shop so they decided to do a big military campaign so the government annexed the whole of Patagonia (orange region on this map and extending all the way south) on one big gulp.