It's a colorful and exaggerated way of saying someone is starving. It's similar to saying "famished" or "starving."
The origin of the phrase isn't completely clear, but it's likely related to the idea of a mug being a large, empty container, suggesting an emptiness or void that needs to be filled.
Here are some examples of how it might be used:
* "I haven't eaten all day, I'm hungry as a mug!"
* "After that hike, we were all hungry as mugs."
It's a common expression in British English and is often used humorously.