A pie is a baked dish which is usually made of a pastry dough casing that contains a filling of various sweet or savoury ingredients. Sweet pies may be filled with fruit, nuts, brown sugar or sweetened vegetables. Savoury pies may be filled with meat (as in a steak pie or a Jamaican patty), eggs and cheese or a mixture of meat and vegetables.
Cake is a form of sweet food made from flour, sugar, and other ingredients, that is usually baked. In their oldest forms, cakes were modifications of bread, but cakes now cover a wide range of preparations that can be simple or elaborate, and that share features with other desserts such as pastries, meringues, custards, and pies. [source]