According to the Encyclopedic Dictionary of the Bible by Louis F. Hartman, C.SS.R., feelings of ill will probably went back before the separation of the northern and southern Jewish kingdoms. Even then there was a lack of unity between the tribes of Jacob.
After the separation of Judah and Israel in the ninth century, King Omri of the Northern Kingdom bought the hill of Samaria from Shemer (1 Kings 16:24). He built there the city of Samaria. In 722 BC the city fell to the Assyrians and became the headquarters of the Assyrian province of Samarina.
When Cyrus permitted the Jews to return from the Babylonian exile, the Samaritans were ready to welcome them back. The exiles, however, despised the Samaritans as renegades. With this came political hostility and opposition.
The Samaritans tried to undermine the Jews with their Persian rulers and slowed the rebuilding of Jerusalem and its temple. The Samaritans later allied themselves with the Seleucids in the Maccabean wars and in 108 BC the Jews destroyed the Samaritan temple and ravaged the territory.
It is with those centuries of opposition and incidents behind their peoples that we can understand the surprise of the Samaritan woman (John 4:9) when Jesus rises above the social and religious restrictions not just of a man talking to a woman, but also of a Jew talking to a Samaritan.