Usually done below a clear cut in ravines where the avalance will go through.
When you clear cut an area, there is nothing to hold the snow back, so the avalance danger increases untill new trees are growing.
Hence the wooden barrier.
In areas of permanent danger, permanent barriers are put up.
I tried to find a picture of the one in Susten pass CH, but no luck.
It is a series of HUGE concrete blocks across the bottom of the valley. looks kinda like part of the old Maginot line.
My first impression when seeing it was that it was to keep enemy tanks out, but then I found out that an avalance once ate the village, so they put it up.