Samsara in Indian philosophy is the cycle of birth, death, and rebirth, indefinitely. Samsara is the constant around which all three religions, namely Hinduism, Buddhism, and Jainism revolve. Samsara’s function is to keep souls trapped under an oppressive spiritual regime that is based on karma. The idea is that if you do negative things in your life, such as impure thoughts, speech and conduct, you will invariably have to bear the consequences of them - those same things are going to happen to you later on when you think you’ve escaped samsara and the negative karma that is attached to your atman (individual Self). Your reactions to these consequences determines whether or not you pay off your debt. If you react with hostility, you will add to your negative karma and your life will get increasingly more painful. If you accept it, you will accrue good karma to balance out your outstanding negative balance. So what happens when you have a surplus of good karma? Well that’s the catch. You are no longer oppressed by consequences, you are now an oppressor as YOUR GOOD KARMA means OTHERS’ BAD KARMA. You are owed, spiritually speaking, and thus when you take advantage of that surplus, you are once again entering the cycle of samsara by virtue of virtue.
The focus of the three religions then is the escape from samsara. Each differs in its take on what it means to be truly liberated.