The children of Israel were slaves in Egypt and Moses was sent by God along with his brother, Aaron to talk to Pharaoh the leader or Egypt about letting the people go so that they may make a sacrifice to God. They originally were not trying to leave Egypt permanently, but Pharaoh, of course, did not keep his word and even after they were given permission to leave, he sent his armies after them.
In order for Moses to convince Pharaoh to let them go, God had given Moses the ability to do miracles with the use of a rod. He turned the rod into a snake, he caused a plague of frogs, plague of lice, and swarms of flies. Then the livestock were stricken, and boils infected animals and people. Hail and fire came next, then a plague of locusts - there was a total of 10 plagues.
Every time Pharaoh would give permission for them to leave, Moses would reverse the plague, but Pharaoh would change his mind again and still refuse to let the children of Israel go.
The final blow was when God said, if he didn't let them go He would strike the first born of every household dead. This would be everyone in Egypt both the Israelites and the Egyptians. Read the entire story in the Book of Exodus starting with Chapter 1 -11.
Exodus Chapter 12 describes the first Passover. Moses and Aaron were given instructions for every household to have a lamb, how to choose the lamb - spotless and without blemish - how to prepare the lamb, and how to kill the lamb.
The death of an innocent lamb was required to cover the sin of a household. The death angel was going to pass over Egypt on this particular night, but any household who had the blood of the lamb on their doorpost was spared.
Were there any people in any of these houses who were sinful? Of course! What determined who died and who did not? - The blood of the lamb!
Exodus 12:12, 23, 30b
On that same night I will pass through Egypt and strike down every firstborn -both men and animals - and I will bring judgment on all the gods of Egypt. I am the Lord. The blood will be a sign for you on the house where you are: and when I see the blood, I will pass over you. No destructive plague will touch you when I strike Egypt.
23 When the Lord goes through the land to strike down the Egyptians, he will see the blood on the top and sides of the doorframe and will pass over that doorway, and he will not permit the destroyer to enter your houses and strike you down.
and there was loud wailing in Egypt for there was not a house without someone dead.
The next day John saw Jesus coming toward him and said, "Behold the Lamb of God, who takes away the sin of the world!