No society can exist without some code of acceptable behavior, but the difference between the Torah and every other system of laws is enormous and fundamental. No man-made law can withstand the onslaught of a person's baser instincts. For a Jew, the essential imperative in social law is not moral, pragmatic or cultural. Rather it is the Will of Hashem, no less than not eating pork or wearing a prayer shawl. This is what gives the Torah's code of social justice power and durability thousands of years after its institution.
All bullies are cowards.
When someone feels there's nobody to stop him doing what he wants, he can become a tyrant. If there's someone waving a big stick, he'll think twice. That's the connection between this command not to oppress a stranger and the Jewish People being strangers in the land of Egypt. Pharaoh felt free to oppress the Jewish People because he thought there was no one to stand up for them. No Big Stick.