In v8 Paul says that, before the Galatians came to know God, they “were enslaved to those that by nature are not gods.” They made sacrifices to idols so they would get a good harvest etc. I suppose the modern equivalents would be slavery to things like money (people work and work to get more and more money, but it never ultimately satisfies), sex, power, popularity… people devote their lives to these things, and they can bring some degree of enjoyment, but they make terrible gods, demanding sacrifices from us while never ultimately satisfying us.
v8-10 – From the context of the letter as a whole we know that the main issue Paul’s dealing with is legalism. People had come along after Paul teaching the Galatians to rely on works of the law rather than justification by faith in Christ, and they’ve begun observing Old Testament ceremonial laws like circumcision and the days and months and seasons and years of the Jewish calendar. And Paul says this is effectively the same as turning back to their old idol worship. Their new religion might look more Christian than their pagan past – the rules they’re following now are taken from the Bible – but they’re turning God’s law into something that’s not really any different from their old pagan religions.
So, if I understand correctly, the elementary principles of the world are “gods” who enslave us by promising rewards if we perform the right rituals and make the right sacrifices. That includes pagan idols who promised a good harvest etc if people offered the right sacrifices, while money, sex and popularity all promise happiness if we devote enough effort to them, and religion promises access to God or heaven if we obey the rules and perform the rituals.
The false teachers in Galatia had twisted God’s law into a religious system where you would work your way to God by your performance, rather than trusting your way to God based on Christ’s performance.
So the question in v9 is why would you turn back to religion to work your way towards God when you already know him, and he knows you? You’re already his son (or daughter); stop trying to work to secure your place in heaven and rest in the fact that he’s adopted you.
If someone reverts to legalism, it calls into question whether they ever really understood the gospel at all. In v11 Paul fears that his work with the Galatians may have been fruitless.