Marriage has been around since before the creation of governments.
It is a simple act of being monogamous with another individual.
Governments created 'marriage licenses' for the purpose of what you are refering to.
But marriage was practiced well before and is the simple act of wo individuals co-habitating, maintaining a sexual relationship, and sharing basic resources such as shelter, food, and parenting responsibilities….i.e. until death do us part.
Before government licensing, family divided the deceased property, but now having a licenses to be married creates all the striff you spoke of.