It is basically a kind of pie with a savoury filling (usually meat, potatoes and vegetables) wrapped in pastry with a crimped edge.
Cornish tin miners took their pasties to the mines as a complete meal; they would hold the crimped edge to eat the pasty without getting it (the pasty) dirty.