The oldest usage from the Oxford English Dictionary (OED) is the most literal, a 1731 reference in a gardening dictionary by horticulturist Alan Van Dyke comparing the shape of the fruits of the cashew and avocado to that of a pear.
The comparison is less literal when the term is applied to people, where it means wide at the hips, a use that goes back to at least 1815, and one that can have either positive connotations (as in Venus figurines) or negative, depending upon the context.
In the 20th century, another, more abstract use of the term evolved. When said of someone's voice, "pear-shaped" means rich and sonorous. The OED dates this use to 1925.
The third meaning is mostly limited to the United Kingdom and Australasia. It describes a situation that went awry, perhaps horribly wrong. A failed bank robbery, for example, could be said to have "gone pear-shaped". Less well known in the US it generated some media interest when British politician Margaret Thatcher used the phrase in front of the world's press at one of her first meetings with President Ronald Reagan, with many reporters being unsure of the meaning of the term.
The origin for this use of the term is in dispute. The OED cites its origin as within the Royal Air Force; as of 2003 the earliest citation there is a quote in the 1983 book Air War South Atlantic (ISBN 0-283-99035-X). Others date it to the RAF in the 1940s, from pilots attempting to perform aerial manoeuvres such as loops. These are difficult to form perfectly, and are usually noticeably distorted—i.e., pear-shaped.
Other theories include: