I've read in many books that afterburners are designed not to affect the upstream engine components, so if there's a large amount of combustion going on after the addition of afterburner fuel, how does the reaction of the air to the sudden acceleration not force air back into the turbine stages?
The afterburner will always affect the upstream flow, as it is subsonic throughout the entire engine (remember, hot air has a higher speed of sound). A properly designed afterburner should therefore not significantly increase the pressure upstream, because this may result in a compressor stall.
Typically this is solved by increasing the nozzle opening area, so that the nozzle back pressure is reduced. Variable geometry nozzles are the norm for reheat capabilities. This in turn keeps the pressure at the turbine outlet roughly the same. Still, most engines require to be at some minimal power level before igniting the afterburner.
It's pretty simple. When in reheat, the core engine is already running at maximum thrust, so the inertia of the mass flow out the turbine section is such that the reheated air has nowhere else to go but out the back.
The afterburner is more or less a ramjet, except with the main engine's exhaust doing the ramming in place of high airspeed.