There aren't grooves in all coffee cups, but some popular ones - notably from Ikea - have them. A groove at the bottom cup is a clever design choice known as a drainage gate. A drainage gate helps direct water away when it's hanging upside down in a dishwasher.