The basic mechanism of [tail-call elimination][tail-call-elimination] is simple: when a procedure reaches a tail call, capture the transformed arguments and feed them back into the machinery of the procedure. Tail calls are thereby made iteratively; they do not accumulate on the call stack.
There is a folklore trick to implement this mechanism using exception handling: in place of a tail call, raise an exception containing the transformed arguments, then catch the exception in order to pass the arguments to a new call. This isn't quite the same as feeding the arguments back into the machinery of the procedure, because a new call is made (with the concomitant overhead of a new environment, etc.). But the previous call is nevertheless popped from the call stack, and thereby eliminated. I could not trace the source of this trick, but it is surely ancient, cf. [Simmons–Beckman–Murphy][Simmons-Beckman-Murphy] (2010), [Norvig][Norvig] (1992, Sec. 22.3