Yes primarily it's to warn other rabbits of danger, if a colony of wild bunnies are out grazing, their heads are low to the floor so a stamp from one of them alerts the others to danger.
Mine do it sometimes if there's strange noises, strong winds or something and Heather always does it when I put her back in the carrier after she's been on the table at the vets :lol:
One time I was fostering a french lop called Dave, he was in a 6ft happyhutch with run attached, so the hutch was 2ft above the floor. We had a visiting fox one night and Dave woke the entire neighbourhood up - a frenchie stamping in a wooden box was just like someone banging a giant drum :lol: