All across Europe and in many other parts of the world, marriage seems to be the mechanism to ally monarchies with each other. Why?
Using marriages to establish or improve political alliances predates not only medieval period, but probably the written history. For instance, we know that the practice was well established in Bronze Age kingdoms: royalties from Hittites, Egypt, Ugarit, Crete, etc intermarried frequently.