Used in names of birds that resemble the magpie, especially in having black-and-white plumage, e.g. sea-pie, tree pie. Recorded from Middle English, the word comes via Old French from Latin pica ‘magpie’, related to Latin picus ‘green woodpecker’.
Pie meaning a baked dish with a top and base of pastry and a filling of fruit or meat and vegetables is probably the same word, the various combinations of ingredients being compared to objects randomly collected by a magpie.
Pie is also used to mean a confused mass of printers' type; recorded from the mid 17th century, the term may represent a transferred use of pie as a cooked dish, with reference to its miscellaneous contents.
a piece (or slice) of the pie a share of an amount of money or business available to be claimed or distributed.
pie in the sky is something that is pleasant to contemplate but is very unlikely to be realized, from a song by the American labour leader Joe Hill (1879–1915).
See also apple pie, eat humble pie, a finger in every pie.