A mug is a type of cup that can hold hot beverages and retain its heat. To mug someone means to attack or rob someone. Mugging here refers to stealing, it's just clever that "mugging" was used as mugs so often hold coffee.
Stealing someone ' s coffee is called ' mugging ' .