expression
serves you right!; see what happens!
A set phrase used to express schadenfreude or satisfaction when someone gets their comeuppance. Often said with a tone of contempt or triumph. The ざま is a derogatory term for someone's state or appearance.
See also: 様見ろ
あいつが失敗したって?ざまを見ろ。
He failed? Serves him right.
調子に乗ってたからな。ざまを見ろって感じだ。
He was getting too cocky. It's like, see what happens.
いい気味 is a noun phrase meaning 'serves you right' or 'good for you', often used in a similar gloating way, but ざまを見ろ is a more direct, exclamatory phrase.
自業自得 is a more formal, proverbial expression meaning 'you reap what you sow', while ざまを見ろ is a casual, emotionally charged taunt.
From ざま (a derogatory term for someone's state or appearance, derived from 様) + を + 見ろ (imperative of 見る). Literally 'look at your state'.