The current capital of China has three names that one is likely to encounter: 北京, 北平, and 燕京.
Any of these names can be pronounced in any variety of Chinese. The current official pronounciations are what we usually call Mandarin, the somewhat artificial standard variety of Chinese based on the dialect of the Beijing area. Strictly speaking, the official language is called 普通話 putonghua "common language" in the People's Republic of China and 國語 guoyu "national language" in Taiwan. Overseas Chinese, especially those in Southeast Asia, often refer to the language as 華語 huayu. The term Mandarin originally referred to 官話 guanhua the language used by officials at the Imperial court. Mandarin is now generally used as the English equivalent of 普通話 and 國語, though a few people would like to reserve "Mandarin" for the larger dialect group to which the standard language belongs so as to avoid ambiguity. The versions of Chinese words that we generally now see and on which romanizations are based is Mandarin.
However, Chinese is a very diverse language. In fact, the so-called "dialects" are by other criteria several distinct languages. Someone from Beijing, for example, cannot understand someone from Hong Kong or Shanghai speaking his or her local variety of Chinese.Since European contact with China was concentrated in the great ports of southwestern China, many European versions of Chinese words are based on the Chinese dialects of the Southwestern coast, especially Cantonese. Place names, in particular, are often based on the usage of the old British-run Chinese postal system, which was based in Hong Kong. This is the probable source of the king of Peking. 北京 is pronounced [pejʧiŋ] in Mandarin but [pakkiŋ] in Cantonese. An alternative theory is that Peking was borrowed into European languages from Mandarin prior to the palatalization of [k] to [ʧ]. Actually, both could be true, in the sense that the unpalatalized form familiar from Southern Chinese dialects like Cantonese may have discouraged Europeans from adopting the later Mandarin pronounciation.
A third factor is how Chinese words are romanized. The main issue here is how the Chinese aspiration distinction is handled. Many varieties of Chinese, including both Mandarin and Cantonese, do not distinguish voiced and voiceless stops and affricates. Instead, they have a distinction in aspiration. If a sound is truly voiced, that means that the vocal folds are vibrating during the sound itself. If there is a substantial lag between the release of the closure of a stop or the end of the frication of an affricate, and the onset of voicing in the vowel, it is said to be aspirated. A sound in which there is no voicing during the sound itself but in which the lag before the onset of voicing in the vowel is short is voiceless but unaspirated.
You can see the distinction in the following three images, which show the
waveforms and spectrograms of the Thai syllables [tʰa], [ta], and [da].
(Thai is a convenient language to illustrate this since unlike English and Chinese
it has a three-way contrast. You can find the audio files here.)
In the first image I've highlighted the aspiration region. You can see
that there is no voicing (which shows up as energy near the bottom of the frequency
range) until the onset of the vowel, but there is a long (70 millisecond)
noise segment between the release of the stop closure and the onset of voicing.
In the second image there is very little aspiration but no voicing during the
In the third image you can see voicing during the stop closure as well as some
higher frequency noise.
In English, the voiced stops and affricates in fact have little voicing in word-initial position, whereas the voiceless stops are aspirated in syllable-initial position in stressed syllables, so English speakers tend to hear the Chinese aspiration distinction as corresponding to the English voicing distinction. Unaspirated sounds seem to be voiced, aspirated ones voiceless.
One system for romanization of Chinese, the Wade-Giles system, is more accurate from a technical phonetic point of view and treats all Chinese stops and affricates as voiceless and using an apostrophe to indicate aspiration. In this system, 北京 is written Peiching and 北平 is written Peip'ing. Peiping is what you get if you use the Wade-Giles system but drop the apostrophe. The other system for romanization of Chinese, which is now official in China, is the Pinyin system. This system writes the stops and affricates in a way that is less technically accurate but more meaningful to English speakers.In Pinyin, 北京 is written Beijing and 北平 is written Beiping. Folk transcriptions of Chinese by English speakers tend to be like Pinyin in this respect.
To summarize, the variation in the form of the name of the capital of China arises from three different sources: