@Dibilnik
The occupation of Gaza and oppression of its people predated Hamas coming to power, and things then got worse with the blockade.
Pre- October 7th:
Geographically, Gaza is a narrow strip, bordered on 2 sides by Israel, 1 side by Egypt and 1 side by the sea. Palestinian waters are severely limited and people can't leave that way. There are two crossing points for people - one into Israel and one into Egypt - and one crossing just for goods. All entry and exit decisions were overseen by non-Gazan security forces. Once you go in, it's not guaranteed that you get to come out. And once you come out, it's not guaranteed that you get to go back in. People crossing could experience harassment and power trips from security guards. To move patients across the border for essential treatments not available in Gaza would take lengthy approval processes and waiting times, and it wouldn't be unusual for the patient to die before approval came through.
Leaving and moving to a new country longer-term, legally, in most circumstances requires a person to have a visa or to seek asylum. As we can see from what the UK government has been discussing with visa rules, it can be very hard to get a visa to settle in a different country. Some people could get visas for studying or work, but that's not an option for most people, just like it wouldn't be an option for a lot of people in the UK to get visas and permanently relocate to a different country.
People couldn't leave other than at the externally approved checkpoints. The land border between Gaza and Israel had a very high fence and snipers watching over the imposed 'no man's land' on the Gazan side.
Supplies that were allowed in were tightly controlled. Some things that we would consider necessary for health, education and wellbeing were forbidden. For example, some specialist baby milk, crayons for children. For some parents, the only way to get baby milk so that their baby wouldn't die from starvation was to use the black market (which ultimately linked back to Hamas a lot of the time). There is evidence that the calorific/nutritional value of food supplies allowed in was in a range that would avoid starvation but would not meet the nutritional needs of the population (so, if people needed more, they would need to go to the black market). Despite that, there was a population that valued education and work, holding on to their culture, which had a lot in common with other countries in the region.
So, the majority of the population were unable to leave and also aware that if they left, they might not get back home. Gaza has been compared with a prison camp and that's not actually an inaccurate image, and reflects how many young men felt.
Once the Hamas government was established, they consolidated power quickly. Many people didn't like them being in power but there was really nothing they could do. In the UK, if you protest against the government you might get arrested and given a suspended sentence or a fine. In some parts of the world, if you protest against the government you might get shot. Many people disliked things but were too busy with trying to get by day to day with their own lives to have much time to devote to any form of regime change. Other people found themselves reliant on the black market and in financial and emotional debt to the people helping them keep their loved ones alive - it can be hard to sustain hate against the people who you believe saved your baby's life, and it can be hard to resist an instruction from those people if you know that disobedience places your loved ones in danger. And some people, often young men who were frustrated at the lives they were forced into and who perhaps had limited or no experience of life without Hamas, were vulnerable to radicalisation.
I firmly believe that there must be justice for October 7th and that the people responsible should face the full extent of the law. To make Israel, Palestine and the world safer, I do think we need to look in the long-term and ensure that whatever the cessation of hostilities looks like, it includes avoiding perpetuating this cycle of people hating each other.
Ok, rant over. That probably didn't make all that much sense as I'm exhausted and a bit upset, I'm afraid. I try not to post when I'm upset, but I wanted to try to answer your question. I don't know if I did though.