Cake on the left; pie on the right.
Cake is made from a mixture of flour, sugar, butter, eggs, and a raising agent.
It has a sweet topping called frosting.
Pie has a filling of fruit or custard in a pastry shell.
Note this exception: What is traditionally called "Boston Cream Pie" is actually a cake.
CJ