Ants also farm aphids, so they may have beaten us to livestock farming too
I can only assume that their purpose is to convert the carbohydrates in the grain into sugars by encouraging the germination process, which they then live off through the winter.
I can’t actually seem to find any documentation of the behaviour, but after seeing them do it for the five years we’ve lived here, I’m under the impression it’s no fluke.