What exactly is "meg" doing in this sentence? It seems to be a preverb, but this preverb wasn't used very much in the course, so I don't really know what it means or what it adds to a verb.
It's means that all of it gets eaten. It wouldn't make much difference here, but it can in the case of "eszik egy almát" & "megeszik egy almát." The former doesn't specify if the apple gets finished.
It looks like you've studied some Russian, so for what it's worth: Hungarian meg is a good bit like Russian по at the beginning of the verb. It can make a perfective verb that expresses completion, or changes some other shade of aspect, or sometimes it just changes the meaning of the verb to something different.
If you pick up any substantial Hungarian dictionary it'll have a thick section of meg- verbs in the M's.
Thank you for that explanation. ^_^ After reading these responses and checking out a Wikipedia article I think I understand what it does; the perfective aspect is just kind of foreign to me since I've never really had to actively study it or apply it. Among the languages I've learned to write in none of them really use the perfective aspect like Hungarian or Russian, so it's simply something I haven't had to learn about yet.
Possibly it is similar to German where "essen" is eat and "aufessen" (literally upeat) means you finish the meal.