Skarns can form on both sides of the boundary between a magma body and its surrounding rock mass. Those formed on the igneous side of the contact are known as endoskarns. Those formed on the country-rock side of the contact are known as exoskarns.
Exoskarns form when the original chemistry of a rock mass is altered – as hot fluids of incompatible chemistry flow or diffuse through the rock. The intensity of alteration and the types of minerals formed can change with distance from the magma body. These mineral variations across the rock mass develop in response to gradients in temperature and chemistry over geography and time.