What's the difference between R&B and pop?

Yeah, on one level “pop music” is simply the music that’s popular.

The word “pop” can also be used to (try to) refer to a specific style or genre of music, but as such it’s really hard to pin down or define. I notice that AllMusic’s list of genres groups pop together with rock (their examples: U2, The White Stripes, Lady Gaga, Chuck Berry), while making R&B a separate category (examples: Alicia Keys, Marvin Gaye, Drake, The Drifters). Whether pop is conflated with rock or with R&B or with disco or whatever may have a lot to do with what style of music was truly popular at the era the person making the categorization first really became aware of different styles of music. And, yes, “R&B” has sometimes been used more or less as code for “music by African-American performers.”