Because "dem" means "them" while "de" means "they". They is the word used in the sentence, not them, so it is "de". I think this is why, someone correct me if I'm wrong, please.
Thank you very much! I gave you a lingot.
Jag älskar svenska så mycket!
Now the problem for me is, how to remember the meanings of those two words, when both of them are so similiar. I'm half german and half portuguese by the way.