Words can be contradicting in their terms of use, and sometimes they are used interchangeably. Most times , what differentiates them is the context in which they are used. Famous and popular may seem similar in meaning, but the two have a context in which they are applied.
Famous means to be well known, while popular means to be accepted, liked, and approved by the people. Example is to say, it's popular among the people, especially when referring to a thing or belief. Popular can imply a person or thing(whether abstract or not) but famous is used to imply a person.
We can't say "the belief is famous" that's because the word famous only describes a person, but we can easily say "the belief is popular". So the context in which they're used play a significant role in their differences. Another example is saying, "this is a famous idea" instead of saying "this is a popular idea". There are popular music, popular dress, etc but no grammar as famous music and famous dress because the objects aren't people
Secondly, famous people are known, popular people are liked and accepted. For one to be popular, he needs to possess certain qualities that the people admire. It takes the act of popularization to make one popular among the people, but one doesn't need to have certain qualities to be famous, all one needs is advertising and doing what he loves to do. Most musicians are famous, but not popular. I know Terry -G as a singer, famous, but I don't like his music. I know Arigga as a famous musician, but I don't like his music. To others, he's popular because they enjoy their style of music, but to me, they're only famous, I know them, but their activities as musicians are not common to me. So, popular people are loved and accepted because of certain qualities, but famous people are known, but may not be accepted by a wide group of people.