“Sorry to keep you waiting.”
You're meeting your friend for lunch at a restaurant. You show up 5 minutes late. You say this to apologize to your friend for being late.
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. Use it like this:
They kept me waiting for over an hour. I was furious!
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. Another example is "keep (someone) guessing" which means that you do a lot of confusing things, so the person has to continue to guess what you're going to do next.