50% of electricity used in Gaza comes (or came) from a diesel-fired power station fed by fuel from refineries in Haifa. The other 50% was fed from the Israeli national grid and from Egypt. The Palestinian Authority paid the bills.
After the blockade of 2007, diesel fuel was smuggled from Egypt, then in 2013 Egypt shut down the smuggling tunnels. The fuel was then supplied from Qatar and Turkey.
In 2017 power lines from Egypt were shutdown. At that time the only electricity to Gaza was provided from the Israel Electric Corporation. Then at some unspecified time later Israel allowed fuel to be delivered again.
You can read about the Electricity shenanigans between Israel, Hamas, the PA and Egypt here:
https://en.wikipedia.org/wiki/Gaza_electricity_crisis
The water supply story is likely very similar.
The story of the blockade since 2007 and the supply of services to Gaza is complicated. I know it would suit the narrative if it were simply "Israel bad, Palestinians good" but that's now how things go.