Pity the capital city of China. No matter what, its name gets mispronounced. It used to be written Peking, but that led to millions of people saying it like an act of voyeurism. Now it’s written Beijing, and anglophones all over the world can’t believe that a j could represent anything like how we say it in English, so in the spirit of foreignness they blubber the b and say the j as though it were French.
In fact, the phonemes involved in the name of China’s capital are such that Peking (the Yale transliteration), Pei-ching (Wade-Giles style, but never commonly used) and Beijing (Pinyin style) are all arguably viable, but all misleading in one way or another for the simple reason that the sounds used are not all sounds we make in English.
The first consonant is a voiceless unaspirated bilabial stop. The closest sound to this in English is actually “b” because we don’t voice our voiced stops very much (i.e., they’re like unaspirated voiceless stops in some languages – the distinction is really a matter of voice onset time, how long after you release the stop your voice actually starts; it is possible to start it even a little before releasing the stop, which we mostly don’t do in English), and we aspirate our voiceless stops when they’re at the beginning of words (we make a little puff of air after releasing the stop and before starting the voice). Linguistically, it’s still voiceless, so the voiceless unaspirated/voiceless aspirated distinction in Mandarin used to be represented as p/p’, but since Mandarin has no voiced stops per se, the Pinyin style just uses b for voiceless unaspirated and p for voiceless aspirated.
The e/ei issue is a matter of how you want to transcribe a fairly subtle diphthong. Since in Pinyin e by itself represents a different sound, ei is the natural and easy choice.
The tricky one is the middle consonant. That’s a voiceless unaspirated palatal stop. If you say “cute” you’ll notice your tongue is much farther forward on the /k/ than it would be on “coat”; the Peking transliteration conceives of the sound as being like the same sound moved even a bit farther forward, right up to the ridge of the palate. The Pei-ching style sees it from the other angle, as a palatoalveolar affricate like our “ch” that’s maybe a little farther back. The j transliteration follows the model of using b and p rather than p and p’ : the aspirated equivalent is written q (because ch and its unaspirated pair zh are made with the tip of the tongue whereas j and q are made with the blade of the tongue). Our closest sound in English really is the letter j as in jack.
But Peking was meant to represent exactly the same sounds; it was just less transparent to anglophones. (On the other hand, Beijing is apparently too transparent for many, who can’t seem to believe they should say it as they see it: “bay jing.”) And Pinyin is less transparent with some other words – consider Xizang Zizhiqu, which involves no sounds resembling our English pronunciations of the consonants involved, except for ng. (We do better to call Xizang Zizhiqu by its better-known name, Tibet, anyway.)