When speaking to the undead dragon using the Eye Of Innos, he says that he planned it that the two would meet.
When you ask him: "Who are you?" he explains that they are both the tools of their gods:
"I bear no name Just as you bear no name."
"I am given the divine power of my creator. Just as you bear the power of your god in you."
"My fate is in the destruction of the world. Just as -your fate is determined by the integrity and virtue of a paladin."
-your hand brings certain death, dragon hunter."
When defeating the dragon, Xardas will teleport to you and will steal the power of The Undead Dragon.