Let's consider the broader context of God’s character.Is God not capable of showing he's God without smiting the Israelites enemies?
I feel we must recognise that God’s ways are higher than ours. His thoughts are higher than ours. As finite beings, we don't fully grasp God's purposes behind his actions. The sons' smiting was a part of God’s good judgment against a people group that had oppressed His people for centuries. This act was about justice.
Moreover, God’s actions in Egypt showed his Kingship. The plagues were meant to reveal His supremacy over Egypt's false and to get Pharaoh to release the Israelites from slavery. They showcased God’s willingness to act for his people.
Let's remember that God’s just. His judgments are always good. As a Christ-follower, I'm called to trust in God's Kingship, even when I don't fully grasp his ways.
God’s actions in Egypt were part of a bigger story of justice, rescue, and faithfulness. I feel that God’s ways are perfect, and that his judgments are always true and good

