You literally typed it out. It is very different to invade the "nazis" than to counter attack them.
There were months of instigation on Israel’s part that led to October 7th. Specifically regarding Israel’s treatment of Palestinians in the West Bank.