After they were established in the truths of grace by Paul, the believers in Galatia abandoned their freedom in Christ, which is complete forgiveness and acceptance (righteousness) with God by grace through faith in Jesus alone.
They deserted grace (Galatians 1:6).
They set aside grace (Galatians 2:21).
They returned to enslavement to their... religious system... rules... rituals... and regulations to earn God's acceptance and forgiveness. In doing so, they fell from grace (Galatians 5:4).
They turned away from all God had freely and fully done for them through the death and resurrection of Jesus, and were trying to earn God's acceptance and forgiveness through religious activity and morality.
Why did they fall from grace?
They allowed someone to cut in on them (Galatians 1:7, 3:1, 5:7) and rob them of their freedom in Christ, convincing them to return to the law (fall from grace) for righteousness.
What did Paul tell them?
"It is for freedom that Christ has set us free. Stand firm, then, and do not let yourselves be burdened again by a yoke of slavery." (Galatians 5:1)
What can we learn from this?
Don't let anyone convince you to fall away from grace, which is all that God has done for you in Christ to secure your forgiveness and acceptance with himself. Don't let anyone convince you to desert and set aside grace by returning to a religious system where you try to earn, through religious activity and morality, what has freely and fully been given to you in Christ.
Stand firm in the gospel of grace.
Stand firm in the freedom which Christ purchased for you, the one who loves you and gave himself for you (Galatians 2:20).