My simplistic understanding of the mechanic:

Princess from faction A marries king or heir of faction B. At some point, faction A expires without an heir. Faction B has a chance of inheriting some of faction A's land.

There may be a myriad of complications we don't know about. Multiple faction A princesses married off to various factions might add a layer to the succession order. If the princess marries an heir and he dies prior to ascending the throne, I believe this renders inheritance invalid. There may be a generational aspect as well.