It uses AJAX.
When you write your query, it searches for the 10 most requested words that match yours. It then writes a miniature JSON to an invisible DIV element. Fast, but still resource intensive.
Try installing Firebug on Firefox or using the Developer Console in Chrome, open the console and start writing "Youtube" or whatever. You will see minimized JSON responses.
Good luck: D
source share