As China again rises to global prominence most Americans are unaware of the key role played by the Chinese in American history, especially with respect to the railroads and gold mines of California in the 1800s and on. Today, San Francisco’s Chinatown remains one of the largest Chinese communities in the world outside of China and Taiwan.
In terms of language, China has two that remain of great significance. The first is “Mandarin”. Mandarin technically has many variations, often depending on the region, but the simplified language explanation is that “standard Mandarin” is the key language of China and the official language of the Government. Although there are many variations of Mandarin throughout China, the standard form can be used by most Chinese. Spoken by about a *billion* people, Mandarin is the most used language on earth. In Taiwan a somewhat different form of Mandarin is used. However Chinese and Taiwanese can communicate well using “standard Mandarin”
The second popular language in China is Cantonese, spoken mostly in the south of China around Hong Kong. Many Cantonese speakers also speak Mandarin, though the opposite is not the case. Although far fewer people in China speak Cantonese than Mandarin, Cantonese is a key dialect *outside of the country* because the majority of immigrants to other countries from China came from only two provinces in China, Fujian and Guangdong.
This is why the Chinese you’ll hear in San Francisco’s Chinatown will almost always be Cantonese.
More Mandarin detail at Wikipedia
More Cantonese detail at Wikipedia