Cantonese is actually a dialect and not a language, contrary to what the above poster said.
Although Cantonese and Mandarin may sound radically different, they are originally from different regions of China (not from different countries) and are unified by the Chinese writing system.
Some people may argue that Cantonese speakers (usually Hong Kong and Guangdong region people) and Mandarin (mainland China) even use different types of writing systems because Cantonese speakers usually write traditional characters while Mandarin speakers usually use simplified characters, but they are actually not considered separate writing systems.
Historically, there was one of very few dialects to begin with, and as people branched out to different regions of China (which is quite a huge country), each region started to slowly adopt it's own accents and speaking mannerisms, which resulted in a different dialect, but the writing system is still the same, hence they are speaking the same language.
Xiao Ming (Mandarin name): Hey what's your name?
Chak Tong (Cantonese name): I cannot understand a word you are saying...
Xiao Ming: OK, how about this? *pulls out sheet of paper and writes a brief introduction about himself*
Chak Tong: *writes on the sheet of paper "Oh, I understand what you are writing but not what you say. Nice to meet you."*