From https://www.washingtonpost.com/world/2023/10/24/gaza-electio...
In 2006, the Palestinian political entity operating in the West Bank and Gaza staged elections. Little did observers know that it would be the last vote allowed by the Palestinian Authority, led then, as it is now, by President Mahmoud Abbas. The vote took place in the aftermath of a turbulent series of events: the fiery years of the second intifada, the death of longtime Palestinian leader Yasser Arafat, and the 2005 Israeli withdrawal of troops and settlers from the Gaza Strip.
The election yielded a shock victory for Hamas, which won the most seats with some 44 percent of the vote.
Edit: is not => is
More nuance would be helpful. The third paragraph from the article you linked says:
In 2005, Israel unilaterally withdrew its military forces from Gaza, dismantled its settlements, and implemented a temporary blockade of Gaza. The blockade became indefinite after the 2007 Hamas takeover, supported by Egypt through restrictions on its land border with Gaza.[14] Despite the Israeli disengagement, the United Nations (UN), the International Committee of the Red Cross, and many human-rights organizations continue to consider Gaza to be held under Israeli military occupation, due to what they consider Israel's effective military control over the territory; Israel disputes that it occupies the territory.[15][16][17] The current blockade by Israel and Egypt prevents people and goods from freely entering or leaving the territory, leading to Gaza often being called an "open-air prison."[18][19] The UN, as well as at least 19 human-rights organizations, have urged Israel to lift the blockade.[20] Israel has justified its blockade on the strip with wanting to stop flow of arms, but Palestinians and rights groups say it amounts to collective punishment and exacerbates dire living conditions.
> In 2005, Israel unilaterally withdrew its military forces from Gaza, dismantled its settlements, and implemented a temporary blockade of Gaza. The blockade became indefinite after the 2007 Hamas takeover, supported by Egypt through restrictions on its land border with Gaza.
Also, I guess Egypt is also occupying Gaza according to you?
It doesn't matter if the prison guards are inside or just surrounding the prison, you're still in prison.
And the only reason the “occupation” transferred to Israel is because Egypt lost a war it started.