So we all know about the Aztecs, the Mayans, the Incas, and the couple other empires/large scale civilizations of South America. And today, the only wholly native peoples of the continent are the small tribes throughout the Amazon. My question is, why? Did the two vastly different peoples coexist? Are they remnants of survivors? Were they slaves? Was there no contact at all until modern times?
First of, the Aztecs and the Maya are not in South America. They are in North America. Second, the strict dichotomy between the complex, agrarian, urbanized societies you've mentioned and "hunter/gatherer tribes" is not so clear cut. Mesoamerica was quite a densely populated area, without a lot of room for nomadic peoples to wander about between the various cities and states. Even in places like the Basin of Mexico, which did open onto an area with large amounts of nomadic peoples, there wasn't a strict cultural or geographic boundary. Let's take the Aztecs, for example. Actually, let's start before there even were "Aztecs."
The Basin of Mexico (shown here ca. 1519) is one of the oldest areas of complex societies in Mesoamerica, with Tlatilco being a contemporary of the Olmecs. Though bounded by a ring of mountains (including active volcanoes) on three sides, the Basin opens northward to the Mexican Plateau. The relatively more arid Plateau represented the end of "civilized" societies (with many exceptions, particularly in W. Mexico) and the beginning of more nomadic people who would eventually be called the Chichimecs. Sometimes this singular label is subdivided into "Teochichimecs" who were completely hunter-gatherers who adopted little to none of the trappings of agrarian society and "Tamime" who lived in proximity to sedentary societies and had adopted, to an extent, agriculture and other practices from them.
Fast-forward about 2000 years from Tlatilco though, to around the 9th Century CE. A new city just North of the Basin, Tula, was gaining prominence in the aftermath of the decline of Teotihuacan and soon become the capital of what we now call the Toltecs. The Toltecs themselves, however, were a somewhat poly-ethnic group formed from the fusion of a Tamime-Chichimec group that spoke Nahuatl and a more traditionally sedentary group, the Nonoalca. Already, we see the boundaries between "civilized" and "savage" being less of a clear delineation and the differences between them being less vast than you may think.
The difference between Chichimec and settled groups becomes even harder to tease apart if we jump ahead a few more centuries. In the mid-12th Century, Tula fell and the Toltec state collapsed, the city of Culhuacan in the Basin of Mexico traditionally being seen as the standard-bearer of the Toltecs. The reasons for the fall of the Toltecs is multifactorial, but one cause we can point to is the disruptive influence of increasing Chichimec migration into the Basin area. The influx of these groups has a climatic factor; the Plateau, along with the US Southwest, was drying up. Ironically, the global fluctuation in climate that caused the increased aridity is better known as the Medieval Warm Period, associated with such things as Norse settlement in Greenland. In the Southwest and Mesoamerica, however, it caused massive drought.
Among the Chichimec groups flooding into the relatively more lush lands to the South were those who would later coalesce into the three groups we now refer to as the Aztecs: the Tepanecs, Acolhua, and the Mexica. Really though, the last group is who we truly associate with the term "Aztec." The Mexica were the last to arrive though, with the other groups Chichimec groups being led en masse into the Basin by a leader known as Xolotl who divided the Basin among them.
That is probably not how it happened, or at least is a very simplified and "mythified" version of what happened. What we can glean though, from sources like the Mapa Quinatzin, Historia de la Tolteca-Chichimeca, and later writings by Tezozomoc and Ixlilxochitl, was that Chichimec groups moved in large numbers to settle among and around the pre-existing residents of the Basin of Mexico. Some of these, such as the Acolhua, who were not previously Nahuatl speakers adopted the language as part of their "civilizing," as it was the language of the Toltecs (this occurred under either Tlotzin or the better attested to Quinatzin).
When the Mexica finally did arrive as the trailing end of the Chichimec migration, their predecessors were already sedentary, urbanized societies. This made the Mexica a bit of an outcast, disruptive group, hence their early history has a couple notable incidents of them basically being forcefully kicked out of an area after settling down too long. Eventually, they ended up as refugees seeking shelter among those inheritors of the Toltec majesty, Culhuacan. Though they were later driven from Culhuacan as well, following a minor misunderstanding over appropriate subjects for human sacrifice, the Mexica-Culhua connection remained strong and they would later seem themselves as a sort of cultural hybrid between the Chichimec and the Toltecs. Indeed, this was the template for the Aztecs: Chichimec groups who adopted and adapted the earlier complex society of the Toltecs, who were themselves the inheritors of an even longer tradition of urbanized society.
Settled and nomadic groups in Mesoamerica (and the Andes and in myriad other areas), in other words, were in constant interaction and forming complex relationships. but no, the groups that you are thinking of in the Amazon are not remnants of Inca or whoever, who fled to the jungle; groups of people do not ordinarily flee hundred or even thousands of kilometers from the homes to set up anew in a completely different ecosystems. Those Amazonian groups were already there and had been for quite some time. Albeit, they were probably there in much greater numbers and with more extensive connections between each other, but malaria, yellow fever, influenza, etc. The reason there are still pockets of "hunter-gatherers" in places like the Amazon is the same reason there are similar groups in the Kalahari and Papua: those areas are difficult to settle in a way that more temperate woodland and open plains are not.
Side note: If you want to know more about the Chichimecs from another, non-Aztec perspective, the last AskHistorians Podcast covered the interaction between Chichimec and settled people in the Lake Patzcuaro basin.