Corned beef

What does the word ‘corned’ refer to ?
Is it for the way the meat was processed, or have anything to do with the little bag of spices that sometimes come with it?
(Had it for dinner and no one knew)

Corned Beef.

A small correction to that explanation. In the UK, the word corn used to refer to any grain, not just maize. Hence, corns of salt = grains of salt.