The fundamental difference between tarts and pies lies in the relationship between the crust and the filling.
Pies are all about the filling. The majority of the flavour comes from the filling; the crust, which is light and flaky, is only the accompaniment. They can be open-top, with only the bottom crust, or also come with a top crust that seals in the filling.
Tarts, on the other hand, have a dense, shortcrust pastry that is shallow and rigid enough for the tart to stand on its own. There is much less filling in a tart, so the crust must carry a part of the overall flavour. Tart crusts closely resemble cookies, both in texture and flavour, but the amount of sugar and fat can vary depending on what suits the filling.
Both tarts and pies can be made with savoury or sweet filling: quiches and custard tarts are both tarts, while there are also pies that contain meat or fruit.
Pies have traditionally been more popular with the working class, as they were easy to transport, and simple enough to make — many people used leftovers as the filling. On the other hand, the upper class preferred tarts for its aesthetic appeal.