What drove Hamas on Oct 7 and what drives them still?

What drove Hamas on Oct 7 and what drives them still?