From the time of the Exodus, and throughout the Old Testament, God has called Himself “Yahweh your God, who brought you out of the land of Egypt, out of the house of bondage,” and because of this they were not to serve any other god. This theme is woven all through Deuteronomy 6-8. Because God had brought them out of the house of bondage, they were to completely reject and destroy all the false gods of the Canaanites. They were not to intermarry because they would turn the Israelites away from following Yahweh. Because He is their God, He would bless them with all good things if they remained faithful to the covenant. Because He has released them from bondage, they were not to take up other gods and become devoted to destruction with them.
In Galatians 4, Paul talks about being enslaved to the “elementary principals” of the world, which points to several different things. First, the enslavement points back to Egypt, and again to Babylon, Persia, Greece, and Rome as guardians placed over Israel. Each of these started as good guardians, but when Israel broke faith with the covenant, they turned against her. Second, the old covenant was mediated to men by angels acting as guardians and managers, so they are angelic tutors set over Israel in her childhood. Third, this refers to everything as it was in Adam, our father according to the flesh. In this sense, the elementary principles are the entirety of the old creation.
Primarily, Paul is referring to being under the law. This is an interesting shift in light of the Exodus. God took them from service to Egypt and placed them in service under the law. This was certainly a change; they were to serve God rather than idols, but they were still enslaved under the law as children not yet ready for the inheritance. The law was the new guardian, the new Egypt. Just as there were those under Moses who wanted to back to slavery in Egypt, there were those in Paul’s day who wanted to go back to the law. He is dealing with these Judaizers, who try to draw both Jewish and Gentile Christians back under the law, in most of his letters.
But, Paul says, the fullness of time has come, the time for us to enter our inheritance as sons. Christ has rescued us from bondage to death and sin, not to return to sin or the guardianship of the law, but to enter into the fullness of sonship. Because we are in Him, we are no longer slaves, but are free as sons and all things are ours.