I can't diasagree with your statement that the IDF, when it strikes, has to stay within th laws of war, which includes doing everything possible to reduce civilian casualties and ensure they only hit targets where the potential for uninvolved civilians to be hurt or killed is proportional to the military benefit of striking the target.
From everything I know, the IDF is hyper-aware of this, and does far more than any other military has done along these lines.
Still, the number of civilians killed is beyond tragic.