They're called
endonyms and exonyms, and it's kind of complicated. In a lot of cases it's basically because of colonialism, which is one reason why some places are reverting, or attempting to revert, to endonyms.
I think there's always going to be some overlap, depending on political and social forces, but in general, I think there's a difference between an imposed, colonial name for a place and the actual translation into another language, and to some extent I think it's up to the people to whom the term is applied to decide whether it's tainted.
We are asked to call Beijing Beijing, but not to call China Zhōngguó, in part because it's an English word when we speak English. Obviously there's some fluidity here. How long was Burma in the language before the country became Myanmar? Or Sri Lanka? But for the governments or the people of those countries, their former names carry too much colonial baggage, if not actual denial of their identity, and even if we might consider it unnecessary or inconvenient (or embarrassing), we return in a way to the issue of why our notion of identity should prevail over theirs.
I'm reminded of an old school teacher, who on the first day of class asked everyone what their nickname was. I said I do not have a nickname. I'm [name]. He said, "fine, I'll call you [nickname]." There was nothing inherently offensive about the nickname, but because it was imposed against my wishes, I found it so.
If a Muslim does not want to be called a Moslem or a Mussalman, fine. If a Yehudi doesn't mind being called a Jew, fine. If our identity is not ours whose is it?