Like the Passover celebration, the dedication of the firstborn helped the people remember what God did during the Passover. God spared the firstborn sons of Israel. Because of this, those firstborn sons belonged to him and had to be redeemed (bought back with a price).
Each year, the people sacrificed and ate a lamb. This act pointed forward to what God would do by giving his Son, Jesus Christ, as a substitute. All people deserve death because of sin. But God redeems them through a price, the life of his Son.