In Exodus 4:22–23 God described the people of Israel like his eldest son. He was their Father. Pharaoh treated Israel badly and refused to free the people from slavery. So God warned that Pharaoh’s eldest son would be killed. That happened in the tenth plague.
The eldest son in every Egyptian household was killed. This also happened with the first male animal born to their livestock. This plague brought judgement against Pharaoh. It also showed that the false gods didn’t have the power to save the Egyptians. But the destroying angel from God passed over the Israelite homes. That happened because they put lamb’s blood around the doors.
After that, Pharaoh let the whole Israelite community and their animals leave Egypt. God gave the Israelites instructions about how to remember the tenth plague and the exodus. They were to honour it every year through the Passover Feast. They were to teach their children the story of the tenth plague and the exodus.
They were to give the eldest male child and animal to God. These belonged to God in a special way. The first male animal born to its mother was to be sacrificed. The animal was sacrificed instead of the eldest male child. This helped the Israelites remember how God had saved them from the tenth plague.