Many of these old barns were either built directly on the ground or a-top a foundation of sorts. Depending on year, location, availability of resources etc. it could be as simple as having stones to complex underpinning work. I suspect they are trying to preserve this barn by squaring it as best they can and building a stone foundation.
This barn has had a mix of restorative work done to it.