The global keyword imports the variable into the local scope, while $GLOBALS just grants you access to the variable.

To elaborate, if you use `global $wp_the_query;`
you can use `$wp_the_query` inside the local scope without using the word global again. So basically `global $wp_the_query` can be compared to `$wp_the_query = $GLOBALS['wp_the_query']`