Both Moses and Jesus were faced with danger at a very young age. At the time of Moses’s birth Israelite boys were being drowned in the river Nile. Pharaoh was worried about the increasing number of Israelites and thought killing all the baby boys would overcome the problem. (I could never understand why he didn’t kill the little girls instead.)
In a twist that only God could have planned, Moses was brought up in an Egyptian household, which gave him the best training for his future role. When in a further twist, the baby’s sister, Miriam, suggested that their mother could care for the baby, instead of paying for child-care the mother of Moses was presumably paid to look after her own baby.
Because of his jealousy King Herod ordered the death of all baby boys. Death awaited Jesus and all the other infant boys, only God’s intervention sending the family to Egypt saved His life. But God reigns supreme, His will is sovereign. God had a special task for Moses, to lead his people towards the promised land and away from the yoke of slavery. Jesus also led His people to freedom and broke the yoke of sin by His redeeming death.