The Chinese language consists of over 400 dialects, with Mandarin and Cantonese being the two most popular.
Cantonese is very similar to what ancient Chinese people spoke, called Classical Chinese or Middle Chinese. The dialect originated from the 广东 (Guandong) province of Southern China. This dialect preserves more of the phonetics and vocabulary of the language spoken in the much earlier dynasties.
Mandarin is a Manchurian-modified version of the Chinese language. When the Manchurians took over China during the Qing Dynasty (1644-1912), Mandarin was formed in the name of 以漢治漢, “to rule the Han Chinese”. They then used this variation of the language to rule the Chinese. It took less than a century for Mandarin to become the official tongue of the capitol. Beijing became a Manchurian-only region, and the Chinese were forced to move to the south. This is why most Northerners speak Mandarin, while most Southerners speak Cantonese.
Today, when asked if you could speak Chinese, Mandarin speakers would ask, “您说汉语吗?” They asked if you could speak “Han language”, since it was originally affiliated with the “Han people”, as used by Manchurians. As for Cantonese speakers, they would ask, “您说中文吗?” They ask if you could speak “Chinese”.