To understand "literally", you have to understand it's opposite. The opposite of "literally" is "figuratively". Saying something "figuratively" means that you're doing something like:
When you speak "figuratively", you don't really mean what you say.
So saying something "literally" means that it's really true. You actually mean what you say.
In the sentence "This was literally the best meal I've ever had.", the speaker says "iiterally" to show that he's not exaggerating. He actually liked this food better than every other meal that he's eaten. Of course, he might be saying that just to make the host happy...
Here are some more examples:
He caught a fish that was literally as long as my arm.
I'm so hungry. I literally haven't eaten a thing all day.