Shechem, a local prince, falls in love with Jacob’s daughter Dinah, and her brothers approve of the marriage as long as he is willing to be circumcised. Given Deuteronomy’s prohibition against intermarriage, later scribes revised the story into a slaughter of the natives. This was too harsh for later scribes, who recast the story as brothers avenging their sister’s rape.
Originally the sons of Jacob saw the interest Shechem took in marrying their sister as an opportunity to plunder Shechem. A later editor, uncomfortable with this story, blamed the carnage on Simeon and Levi, and added the rape of Dinah as a motivation for their actions.