-담 and -람 are sentence endings that make a rhetorical question directed to oneself. It's a form of soliloquy.
You use it in reaction to something annoying or confusing to express your displeasure, with the tone of "I don't like/understand this.".
1 얘는 왜 저런 사람을 좋아한담 = Hm, I can never understand why she likes a guy like him.
2 이게 뭐람 = 이게 무슨 일이람/꼴이람 = I can't believe this / I don't like this.
3 버스가 왜 이렇게 안 온담 = Why the hell is the bus taking so long to come.
4 이 사람들은 무슨 생각으로 이런 짓을 했담 = What were they thinking to have done something like this.
You say 담 when the end of the phrase (except the very last syllable) is a consonant-ending one, and 람 otherwise (as in #2 above)