Origin 800 BCE to 500 BCE
Samsara is wandering on: the beginningless process in which beings are born, die and are born again, driven by action and the craving that motivates it. It is the problem that the Dharmic traditions exist to solve, and understanding that it is the problem rather than the setting is the first requirement for reading any of them.
It is not purgatory, and the comparison fails at every joint. Purgatory is remedial, temporary and terminal, it purifies, it ends, and everyone in it is going somewhere better. Samsara purifies nothing; it has no end unless one is achieved; nobody administers it; and it includes the pleasant destinations as well as the unpleasant ones, so that a rebirth in a heaven is a continuation of the difficulty rather than an escape from it. Above all, the aim is not to complete the process but to stop it.
The traditions differ over what it is that continues. Hindu accounts generally have an enduring self that transmigrates, taking bodies as one takes clothes. Buddhism denies any such self and therefore has to explain rebirth without a transmigrating entity, which is one of the harder problems it sets itself; the classical answers use images of causal continuity without identity, one flame lit from another, neither the same nor different, and the later schools develop the notion of a continuum of mind rather than a thing that travels. Jainism has an enduring soul which is literally weighed down by the matter that adheres to it.
The tone is worth noting because it is often missed. Rebirth is not presented as a consoling doctrine or a second chance. It is presented as a predicament, unbounded in extent, exhausting, and to be got out of.