Pie, the thing used liberally around here, doesn't have a concrete etymology (like many words), but one intriguing hypothesis:
Originally referred to Magpie (bird), from a root meaning pointed.
Mag was added to pie because Mag is a shortening of Margaret, which was a generic term for a woman (thing modern Little Suzy or Jane Doe). This link was made because (CW: sexism) the bird, like women, are viewed as chatty (/CW).
When the dish was invented c. 1300s, pie was transferred because like the bird's nest, pie could contain miscellaneous foods, indiscriminately (meat pies, fruit pies, etc.)