I've found a website explaining it https://www.envie-de-queyras.com/news/cairn-kairn-tas-pierre-monticule-amas-sentiers-rando
Here's the translation from google:
But what is the meaning of these heaps of stone that we observe on our paths?
These are marks left by previous hikers, making it possible to mark the path or materialize a peak, and thus make it possible to clearly identify the path.
How is the Cairn materialized, what form does it take?
They take the form of a heap/mound of stones in a pyramid, and are most often located in places where it is difficult to maintain a clearly demarcated path/path or paint markings (e.g. in scree, scree, or rocky passages).
Who builds and places cairns?
Each walker is thus encouraged to add his own stone (to the building), in order to enrich the beacon/marker.
The guides or staff in charge of trail maintenance also maintain these small piles of stones.
Etymology of the word Cairn
It would come from the Scottish word càrn, pile of stones affixed to materialize a burial or the top of the hills