I'm not sure how far back the saying goes (if you can find an early literary use of this aphorism, please share).
Its origins lie in the not-so-distant past when women were far more dependent on their husbands than they may be today.