"a second marriage represents the triumph of hope over experience."
We think it's a sort of cynical wisecrack - you couldn't get along with A but you're sure you'll get along great with B. We think it's about divorce. In Johnson' time there was hardly any diverce. But there was a lot of early death. The way you parted from your spouse was, she died. Johnson's did. So that was the experience, love somebody and she dies. The hope was the new one wouldn't die.
[from John Crowley, "Dæmonomania"]