You're meeting your friend for lunch at a restaurant. You show up 5 minutes late. You want to apologize to your friend for being late, so you say:
Sorry to keep you waiting.
This is a way to apologize for a small mistake you made. When you make a larger mistake and want to apologize more strongly, you can say "I'm sorry for ___ing":
I'm sorry for making you wait so long.
But being 5 minutes late to a lunch appointment is not a big mistake, so saying "Sorry to keep you waiting" is a perfect way to apologize.
To "keep someone waiting" means to make them wait for a while.
When you use "keep" in this way, it means to make something continue. So to keep a person waiting means that you've made them continue to wait. To "keep someone guessing" means that you do a lot of confusing things, so the person has to continue to guess what you're going to do next.
(Print this lesson)