There are several theories.
One is that the phrase refers to greased-pig contests once held at county fairs, where the winner kept the pig and thus brought home the bacon.
Another theory revolves around the town of Dunmon, England.
There, in A.D. 1111, a noblewoman decreed that any person who knelt at the church door and swore that “for 12 months and a day he has never had a household brawl or wished himself unmarried” could claim a side of bacon.
Thus, a man who brought home the bacon from Dunmon was, at least according to his own oath, enjoying a good marriage.
Over the five centuries in which records for this event were kept, only eight people won the prize.
Yet another possibility is that the phrase stems from the eighteenth-century use of bacon as a slang term for the rewards brought home by a criminal.