Cairns are being made and used as landmarks since ancient times. In prehistoric times they also had the meaning as monuments for the dead or to mark defense lines, to indicate areas for hunting or for ceremonial purposes.
Later on early pilgrims brought a stone from home and carried it with them on their journey to only discard of it on the Cruz de Ferro as a symbol of laying off their sins.
Nowadays everyone walking the Camino, or elsewhere, makes a pile of pebbles. Some of us even think that walking to Santiago de Compostela (or walking a part of it) is not valid without deposing of (a) pebble(s) any place, any where. There are parties criticizing this heaping up of stones saying that it is impacting the environment as sometimes the pebbles are left on plots of land or other places where they can be a nuisance to the local habitants.