Hamas is the result of the Palestinians never accepting the existence of Israel, full stop.
The Palestinians didn't have a nation of their own: they were part of the Ottoman Empire and the UK got them as spoils of war.
The Palestinians were offered a state, but because it was only part of Mandatory Palestine and therefore thwarted Pan-Arabist ambitions, they instead went to war, and lost.