So, "give the X to the Y," that construction corresponds to the thought "cause X to go to Y." Whereas "give the Y the X" corresponds to the thought "cause Y to have X."
Entonces, "Dar X a Y" — esa construcción corresponde al pensamiento "Causar que X vaya hasta Y". Mientras que, "Dar a Y X" corresponde al pensamiento, "causar que Y tenga X"