It was a nice feeling, sitting there with Ron, eating their way through all Harry’s pasties, cakes, and candies (the sandwiches lay forgotten).
In this sentence, what's the meaning of 'their way'? Is it having the function of adverbial phrase?
Grammatically it is the direct object of eating.
Semantically, the idiom eat one's way through means to eat, with a connotation that there is a lot of food.
It is an example of what you might call an "idiom schema" that can be used with various verbs which refer to actions one might do on a lot of individual items, again with a connotation that there are many things to deal with:
But I think that eat and work are the most common verbs you will find in this schema.