Actually, Cantonese is much, much closer to ancient Chinese than Mandarin is. The different tones of ancient Chinese were mostly preserved in modern Cantonese, but Mandarin has merged them into just four tones over the centuries. Cantonese also evolved from ancient Chinsese, but there were far fewer changes in pronounciation.
Try reading through an ancient Tang poem. You will find that it rhymes and flows more naturally when read in Cantonese than in Mandarin.
If you send a Mandarin speaker and a Cantonese speaker back to the Tang dynasty, the Mandarin speaker would likely be unintelligible to the Tang people, whereas the Cantonese speaker would probably be understood with some difficulty.
Mandarin did not become dominant until it was heavily promoted by the government with the founding of modern China.