When the people of Israel were brought of Egypt, the land of slavery, it was just the beginning. And what they were about to learn was a new kind of freedom. It was a freedom that was not just for them, but for everybody. God’s vision for his people was that they would bless the entire world. In other words, that they would bring freedom to all people. This is why he reminds them again and again, “you were slaves.”
If they could remember this, and what it was like then they would seek to bring freedom to all people. One of the greatest dangers for the people of Israel would be for them to forget what God had done in liberating them. Because if they did, they may lose sight of what true freedom is and become enslaved once again.