This question already has an answer here:
The best explanation is with an example:
Ich habe ihm gesagt, dass ....
"Er" becomes "ihm" in the dative.
If we have a "normal" relative pronoun, then we get
Der Mann, dem ich gesagt habe, dass ...
"Der" becomes "dem" in the dative. So far so good.
But what happens if we have a genitive relative, eg
Der Mann, ??? dessen Sohn ich gesagt habe, dass ...
We'd have to "decline" "dessen" in the dative, but is there such a thing? Are we then forced to put a "zu" in the ??? part? Or does the pronoun become "dessem" (I think not)? Or yet something else?