Cottage pie (or shepherd's pie when made with lamb) is a meat pie with a crust of mashed potato. The dish is commonly made with beef.
The term cottage pie was in use by 1791, when the potato was being introduced as an edible crop affordable for the poor (cf. "cottage" meaning a modest dwelling for rural workers).
In early cookery books, the dish was a means of using leftover roasted meat of any kind, and the pie dish was lined with mashed potato as well as having a mashed potato crust on top.
The term "shepherd's pie" did not appear until 1877, and since then it has been used synonymously with "cottage pie", regardless of whether the principal ingredient was beef or mutton.Folk etymology has led to the term "shepherd's pie" being used when the meat is lamb, as shepherds are concerned with sheep and not cattle.