I can imagine that this is true, but is it actually legally spelled
out and motivated? Or is it just what tends to typically happen, for
"other reasons"? . . . Is this actually a legal thing? Something which is in a
legally binding "marriage contract" (I don't know if that even
exists)? If so, what's the reason for this?
It isn't really true and isn't particularly typical either. The perception is mostly "mood affiliation" (i.e. a tendency to interpret anecdotal evidence in a manner that confirms your inclinations about how the world works before seeing any evidence). But there are some circumstances that do tend to cause very unequal property divisions to arise and when that happens more of the visible tangible property like real estate, tends to end up owned by a wife more often than a husband, on average.
Many countries with civil law systems, such as Spain and France, have a "community property" system also shared by some U.S. states, in which a husband and wife are equal present co-owners of property acquired during the marriage by means other than gift or inheritance, without regard to title. There are numerous variations on this theme due to subtle but important differences in how appreciation and depreciation in separate property is handled and how separate property that is encumbered by debt is handled. The parties can trade their interests in marital property (or separate property) with each other upon divorce, however, to completely split up the divorced couple economically.
Countries with a common law history of marital property typically use equitable division of marital property upon divorce, a system that the answer from @MichaelSeifert explains well.
Overall divorce settlements in the U.S. and Europe are usually close to equal in economic value, after adjusting for alimony awards that are intended to compensate for economic specialization and reliance interests in a marriage, especially a longer marriage or one with young children.
But there are a variety of reasons for unequal property divisions. The three of the most common ones (not necessarily in order of frequency) are pre-nuptial agreements, lumpy assets, and lump sum alimony considerations. Often these arise by mutual agreement in lieu of default rules of law, rather than by court order.
Unequal Property Divisions Due To Prenuptial Agreements
It is also possible in most circumstances to enter into a marital agreement, especially a pre-nuptial agreement, to modify the default rights of a spouse upon divorce and to inheritance. These are most commonly entered into either between spouses later in life, often in second or later marriages whose prior spouses have died, typically to maintain separate financial existences that preserve the status quo for their heirs, or in situations where one spouse is very affluent and the other is not.
In the latter case, a pre-nuptial agreement typically provides that upon divorce the "poor spouse" (both men and women) receives a property division that is bigger than what would be received following a divorce to someone of comparable means to the "poor spouse" but much smaller than what would be possible following a marriage between the "poor spouse" and the "rich spouse" in the absence of a pre-nuptial agreement.
Sometimes the "rich spouse" is not actually currently "rich" but is likely to receive a large inheritance in the future in a jurisdiction that has equitable division or has a career that was established prior to the marriage but is about to "pop" (e.g. a doctor marrying just as she finishes her residency, a lawyer marrying just as he finishes a U.S. Supreme Court clerkship, a baseball player just transferring to the major leagues after long years in the minor leagues, an actor just cast for a first big movie, etc.)
Unequal Property Divisions Because Assets Are Lumpy
The first is that typical households own property that is "lumpy" with individual assets are not prone to being divided equally. Three particularly "lumpy" assets are a home, a small business, and a defined benefit pension plan (which can be split but can be expensive to divide).
If the house is to continue to be used as a home by one of the spouses, which can be desirable because it can provide greater stability to the couple's children and continuity in schools and neighborhood friendships for them, it usually makes sense for one spouse or the other to get the house.
If there is another "lumpy" asset associated with the husband's livelihood in a couple where the husband has the higher earning employment and the wife has compromised on her career to allow her to focus more on raising children, which remains more common than a desire to avoid traditional stereotypes might suggest, a common compromise is to award the residence to the wife and to award the small business or the defined benefit pension to the husband. If this still results in an inequality of values one way or the other, it is common to have the spouse receiving a disproportionate share of the assets make a significant property settlement payment (basically in the form of a promissory note owed to the spouse receiving the smaller share) over a manageable period of time to balance out the division. But, assets like a property settlement payment or a defined benefit pension plan are often invisible to an outside observer.
Suppose that both spouses are young and have had only a five year marriage. One is a postal worker and the other is a school teacher, both of whom have reliable salaries and secure employment, who have benefitted from rising real estate prices so they have substantial equity in their homes, but really own no other assets to divide. Giving one spouse the house, and having the spouse who receives the house buy out the spouse who doesn't receive the house in a property settlement payment over a period of years, can be a workable solution to equalize the divorce settlement and subsidize the rent payments of the spouse who doesn't get the house. The teacher may find it more desirable to continue to live in a house near the teacher's work, and the couple may find it more desirable for that house to continue to be their elementary school aged children (they had kids before they married) continue to have continuity in their lives.
Unequal Property Divisions As Lump Sum Alimony
The second situation where unequal property divisions are common are where there is an arbitrage between alimony and property division. The starting point for a divorce settlement is typically an equal property division and alimony payments from a higher earning spouse to a lower earning spouse for a period of time that reflects their relative incomes, the length of the marriage, and burdens associated with the post-divorce parenting realities that are agreed to by the parties. Not infrequently, alimony is for a period of time calculated to facilitate a spouse who compromised on a career time to obtain education or job skills or work experience to allow that spouse to "rehabilitate" occupationally.
The problem with alimony awards, however, is that they represent an ongoing drain on the spouse paying them, which there is a risk of becoming particularly burdensome if the income of the spouse paying alimony declines, and there is a risk for the spouse receiving alimony that payments will be made late or not at all interrupting the finances of the spouse receiving them. But collecting alimony through litigation can be expensive (legal fees in a case like that are often a 50% of the amount recovered contingency fee), slow, and uncertain, particularly in cases where the paying spouse is self-employed or has irregular employment or a highly variable income (e.g. a spouse whose is paid primarily on a commission basis).
To reduce the risk for both sides, in marriages where this is a risk (you don't see this often in divorces where the alimony paying spouse is a tenured professor, or a salaried civil servant with great job security), it isn't uncommon for an alimony award to be greatly reduced or eliminated, in exchange for a disproportionate division of marital property that reflects of present value of the future alimony payments that have been foregone by the spouse who would otherwise receive them.
For example, suppose that husband works as a realtor who has a high average income, but receives only three or four payouts a year that vary greatly from year to year, while wife works as a teacher's aid in a neighborhood elementary school making far less on average, but with a steady paycheck every month. Under local law, husband would most likely owe $1,500 a month to wife as alimony for ten years. The couple also co-own a residence, and the husband owns a hunting cabin in the wood that he inherited from his uncle with significant value that is separate property. It wouldn't be uncommon for the couple to reach an agreed property division settlement in which wife receives full ownership of the residence and the hunting cabin, which constitute almost all of the couple's marital property, in lieu of alimony. The husband doesn't have to worry about making a monthly alimony check when some years he gets paid only twice a year when he sells properties in a slow year, and the wife doesn't have to worry about late payments from the husband or having to sue him. Wife may end up selling the hunting cabin and/or the residence if she needs greater liquidity, but that is something that she can control. Husband may agreed to continue to guarantee the mortgage on the residence until it can be refinanced when the wife qualifies for that kind of loan, or when the house is sold.
Of course, in situations like these, the public sees the unequal real estate division and not the foregone alimony rights.
Theory v. Outcomes
Western divorce laws are designed with a big picture goal of leaving both spouses into a state of stable, approximate economic parity, in which a divergence in the former spouse's economic circumstances more than several years down the road is due to circumstances individual to each spouse, rather than being a fallout of the divorce settlement.
When both spouses have full time careers, and the couple has no children, or when both spouses are retired, this is what tends to happen, somewhat diminished due to the loss of economies of scale like shared housing.
But when the couple has children, and one spouse has a primary career, while the other, usually the wife, has a secondary career that was put in second place in order to become the primary caretaker for the couple's children, these rules rarely have that effect. Instead, husbands who had a primary career in the couple tend to have stable or slightly improved economic prospects, without much regard to any remarriage, notwithstanding the fact that they often have child support and/or alimony obligations, while wives tend to see their economic prospects starkly diminished when they don't promptly remarry.
Formal legalistic efforts to evenly divide property, and customary awards of child support and alimony, discounted further by the common reality of late payment, or partial payment, or non-payment, sometimes for understandable economic resources (lots of men who don't pay their divorce obligations are unemployed or underemployed with poor economic prospects) and sometimes for less noble reasons (resentment and bitterness from the divorce and knowing that they are hard to collect from). Some of this is also a systemic consequence of the fact that divorces are more common when husbands are doing poorly economically, fixing settlements at a fairly low level, from which husbands sometimes subsequently rebound.
These post-divorce economic disparities tend to have less impact in Europe, where social safety nets tend to buffer weaknesses in the long term parity of divorce settlements, but can have considerably more impact in the United States where the social safety net is much thinner.
The other complicating factor is that there is a huge socio-economic class divide in divorce, in the United States, at least.
Marriage rates are fairly high by last half century standards, and divorce rates for college educated couples are as low as they have been since the late 1960s. These marriages usually involve couples who married later when they were more economically secure or had sure economic futures, and involve children usually born after the couple marries. Wives in these couples, despite having solid income earning capacities in absolute terms, also tend to be much more economically dependent upon their husbands to maintain their standard of living, because in highly educated professions and careers the income penalty for taking even a few years out of the work force and making a job a second priority for a few years is very high.
Also, for these couples, divorce decree terms are meaningful. Alimony and child support payments are collectable. There are meaningful net worths of couples to divide and the marriages ending in divorce also tend to have been longer on average. Child custody decrees are also meaningfully enforceable because the parties are either sufficiently educated to somewhat competently represent themselves in court in these disputes or can afford to hire lawyers if child custody decrees are violated.
In contrast, couples where neither spouse has any college education face a very different path. They are more likely than not to have had children before marrying. They divorce at historically unprecedented rates and typically have shorter marriages than more educated couples. They tend to be younger when they first divorce. Property division for these couples isn't very meaningful because neither spouse has much property of any significant value. Child support and alimony awards are much smaller, and when the husband is obligated to pay them, are prone to being interrupted, because the inflations adjusted income of high school educated men has been largely stagnant for fifty years and because high school educated men have very high rates of unemployment and work related disabilities. Often a husband's weak employment status or prospects is one factor that motivates couples to divorce. And, while wives with only high school educations have much less earning power in absolute terms than those with college educations, there is typically little or no income penalty in the kinds of jobs they work at for taking some time off to focus on raising children or for temporarily prioritizing raising kids relative to their jobs. Also, since their families are typically much more economically struggling in the first place, they are more likely to have jobs that provide a significant share of the family's income at the time of divorce, and a smaller household can mean stretching that small paycheck less far.
In practice, for these couples, divorce decrees aren't very meaningful. Usually neither spouse has the education or inclination to represent themselves in court effectively, or the ability to hire a lawyer to enforce violations of child custody arrangements that have been decreed or to enforce unpaid child support, alimony or property settlement debts in an economically efficient manner. When courts intervene in these cases, it can be almost random, because it happens so sporadically.