According to hinduism, what determines how a person is reborn

According to Hinduism, a person's rebirth is determined by their actions, known as karma, in their previous lives. Karma refers to the moral law of cause and effect, where every action has consequences. Good actions lead to positive karma (punya), while bad actions result in negative karma (papa). The accumulation of karma determines the conditions and circumstances of a person's rebirth, including their species, social position, and experiences in the next life. The ultimate goal in Hinduism is to break the cycle of reincarnation, known as samsara, and attain moksha, liberation from the cycle of birth and death. This is achieved by acquiring good karma through righteous actions and spiritual practices.