Pink curing salt is dyed so nobody mistakes it for table salt
Curing salt, a mix of ordinary salt with nitrates or nitrites, is often coloured pink on purpose. None of its ingredients is naturally pink; the dye simply keeps it from being confused with table salt. Those nitrites are also what give ham its rosy colour and help block the bacteria behind botulism.
Curing means preserving meat, fish or vegetables with salt, which draws water out by osmosis and leaves conditions too salty for spoilage microbes. Doing that requires salt at nearly 20%. The practice reaches back to antiquity, drying was its earliest form, and until the late 19th century it was the main way to keep meat and fish. Smoking, spices, sugar and nitrates are often added.
Each ingredient does a particular job. In sausages, salt pulls soluble proteins to the surface, where they set during cooking and bind the meat together. Sugar, whether honey, corn syrup solids or maple syrup, adds little flavour except in bacon but softens the salt's harshness and feeds helpful bacteria such as Lactobacillus. Some traditional products, including authentic Parma ham, use salt alone.
Nitrite is the chemistry behind the colour. It breaks down into nitric oxide, which latches onto the iron at the centre of myoglobin, making raw cured meat reddish brown and cooked ham pink. The United States has formally used nitrite and nitrate salts in meat since 1925. Because nitrite is fairly toxic, with a lethal human dose around 22 milligrams per kilogram of body weight, US rules cap it at 200 parts per million.
Nitrites can also form carcinogens such as nitrosamines, and in 2015, after reviewing more than 400 studies, the World Health Organization's cancer agency put processed meats in its Group 1 category of human carcinogens. In most wealthy countries curing now survives mainly for taste, texture and tradition, while in poorer ones it remains central to producing and transporting meat.
Source: Curing (food preservation)