Sigh. This is at least the third year I’ve explained this, it’s really simple.
As CZ said a pie is foodstuff enclosed in pastry, just as a sandwich is filling literally “sandwiched” between two slices of bread. So a meat pie is a self-contained pastry crust containing meat, ditto potato pie, etc.
With things like “cottage pie,” this is simply the name of the dish as a whole, it is not a pie containing cottages. Similarly shepherds pie and, as someone else mentioned earlir (and will no doubt come as a disappointment to some), pot pie.
See also, beef wellington, Chorley cakes and club sandwiches.