Firstborn sons and firstborn donkeys belonged to Yahweh, but Yahweh did not want them sacrificed to him. Instead, the Israelites were to sacrifice a lamb in their place. This allowed the Israelites to redeem or buy back the donkeys and sons from Yahweh.