The ancient Chinese believed that after someone died, their spirit lived on in the afterworld. The spirits of family members, who had died, watched over you. These spirits of your ancestors had magical powers. They could help you or hurt you. Family spirits included all of your ancestors, going back hundreds of years, any of one of whom could help or hinder.
The most important place in each ancient Chinese home was a shrine they used to honor their ancestors. They also brought gifts of food and wine to their temples, to honor the spirits of their ancestors. Celebrations were held to honor their ancestors. Ancestor worship was the Chinese way of keeping their ancestors happy.
When girls married in ancient China, they moved to their husband's home. Once that happened, once they became a wife, they could no longer worship their own ancestors. They had to worship their husband's ancestors and be loyal to their husband's family.