I'm going to start with our standard, AskHistorians trademarked disclaimer: the Middle Ages were a roughly thousand year period of history that spanned a huge geographic area across multiple cultures and it is very hard to write an answer in this short space that could come close to answering a broad question about them. I have worked mostly on "the big three", that is England, France, and Germany, and I can give you a bit of a general sense of what's going on.
First, there's a certain implication in your question that perhaps marriages and maybe even family life were political first. This is very true, although it is sometimes over emphasized. We have lots of direct and indirect evidence of affection between medieval parents and their children, and usually parents would have at least half an eye toward the happiness of their child, son or daughter. However, the ways that medieval people thought about family and happiness were different than ours are now. Modern parents in places like western Europe and the USA are more interested in their child falling in love and being with that person as their partner, expecting financial security and other issues to be worked out by the couple in the context of the loving family relationship. Medieval parents were far more worried about the financial stability of the relationship. Spouses were in some ways more like business partners, and a good wife might need to manage her husbands estates while he was away, make financially prudent decisions, and produce heirs to inherit the family wealth. A husband should protect the financial and political interests of his wife and children, as well. So a father making a marriage decision for his daughter was doing what he thought was best for her (and his future grandchildren) when he found and negotiated a financially prudent match, and then partially funded the match via a dowry. And this was one advantage for him. A daughter married well. This is of course generalized and a bit theoretical. There were love matches and elopements in the Middle Ages, asshole fathers who didn't give a shit about their daughters, matches that were forced purely for political reasons and that were bad deals for one or both parties, even kidnappings in which a woman was forced to marry against her will.
Now, on to the political. Rich families in the Middle Ages, headed by what we sometimes call the great magnates, functioned in some ways like political and economic units. There's a new-ish book about this called Princely Brothers and Sisters: The Sibling Bond in German Politics, 1100-1250 which explores some of these relationships in the Holy Roman Empire. The basic thesis of the book is that siblings helped each other politically and economically by working together in order to pursue family wide goals. This is a fascinating analysis because it shows how the different relationships within the family played out, as uncles or grandfathers stepped in to guarantee certain inheritances to the different children, brothers backed each other's claims on pieces of land, and entire families lobbied the king. Having an interconnected family was a really important piece of political power, and when it worked families became very powerful. This naturally induced kings to try to use their children in order to increase family power. Marrying princesses into the major families would serve that goal, and the dowry would further cement the alliance and provide for the daughter and her children in her new family.
The most prominent example of this is the late medieval/Early modern marriage practices of the Hapsburgs. But there were plenty of other practitioners making good alliances.
Despite this, marriage alliances sometimes failed spectacularly. You can probably at least refer to Catherine of Aragon and her marriage to Henry VIII. There was significant conflict over her position in the English court, even with her marriage to Arthur, and the Spanish and English bickered over the marriage and her dowry. There are also references to the futility of marriage alliances in Beowulf. The Finnesburg Fragment, which is a poem-within-the-poem talks about fighting that broke out between a wife's clan and her husband's. Hrothgar's daughter has also been betrothed in order to stop fighting between the Danes and the Heathobards, however the poem implies that the alliance will only temporarily stop the fighting.