Important context is always left out of the conversation about Israel and Gaza. What often occurs is that Israel will retaliate against indiscriminate rocket fire. Israel retaliates against the rocket fire by targeting the places the rockets are being fired from. Hamas and PIJ both use civilian buildings, like schools and hospitals to store and shoot rockets.
In 2021, multiple PIJ rockets either misfired or fell short of their targets, killing Palestinian civilians, for which activists and journalists pointed the blame at Israel.