How does the Dynasty mechanic work?
You need a ruler from the same dynasty as another country to be able to form a Personal Union via war.
So how exactly can I raise my chances to get rulers from the same dynasty between me and another country?
Obviously you have to have a royal marriage, but is it pure luck from there or is there anything I can do?
How exactly does the game decide which dynasty a new ruler will belong to?
Having a higher prestige then your royal marriage partners and have a positive relations. When their King/Queen died without a heir then a Noble from your dynasty takes over throne.