It comes from "My Lords, Ladies and Gentlemen". Titled men come first (My Lords); then their spouses [My] Ladies; Ladies also include non-titled ladies; and finally, untitled men (Gentlemen). Debretts, Preamble Precedents. The following list gives the form in which important guests should be included in a preamble in order of precedence: More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.