Well, "literally" has the following 2 main meanings:
1. Word for word to understand what's being told.
2. To emphasize the truth or actions.
Sometimes English native speakers use metaphors to describe something without saying it "literally", so when they'd like to emphasize it, they'd say it as it looks by using "literally" instead of "do/did/does".
For instance,
He "literally" exploded with rage. = He "did" explode with rage. = 他“簡直”氣炸了!= 他“真的”氣炸了!
meaning,
He was "really really really" angry!