This is a very important concept which many miss, so it's a shame it's being downvoted.
Marriage is not a contract between two people, as many people think. Marriage is a contract between a two people, and society. The way you can tell is exactly because two people can live together all their lives, by their choice, without being married, but they don't get any of the societal benefits of marriage. All the marriage rights, fore example, but also social acceptance of their having children.
In fact, that's mostly the point of marriage. The contract benefits society by making more stable family units that will raise children, and be permitted to do so. The contract benefits the couple by giving them many legal rights and recognitions, including monetary advantages, that they couldn't get otherwise.
In fact, it's only in the last few years (relatively speaking) that marriage was even necessarily between two people who choose to be married to each other out of love, and it's still not that way in all cultures.