ずにはすまない・ざるを得ない: the difference
ずにはすまないN1
Meaning
Won't get away without, Won't get off without, Have to, Have no choice but to, Can’t not
Past papers
Example
重要な会議だから、間に合わないではすまない。
It's an important meeting, so I won't get away without making it on time.
ざるを得ないN2
Meaning
Can't help doing, Have no choice but
Past papers
Tested 3 times in past papers
Example
サプライズのプレゼントに、驚かざるを得なかった。
I couldn't help but be surprised at the surprise present.
How to tell them apart
「〜ずにはすまない」: social duty or responsibility; things can't be settled unless you do it (apologize, compensate, be punished).
「〜ずにはいられない」: an urge you can't hold back (laughing, crying).
「〜ざるを得ない」: circumstances leave no other choice; you have to do it against your will, e.g. have to resign.