The greatest difference between Obama and McCain during the 2008 Presidential Election is that McCain had much more experience in government than Obama.
Regarding McCain, in 1982, he was elected to the House of Representatives of the United States, where he served for two terms. He entered the US Senate in 1987 and easily won re-election five times, the last time in 2016.
About Obama, prior to his presidency he only served as US Senator for three years.