Wow, I never realized so many people were confused about what CGI was. There is plenty of information on the W3C's Web site.
The query string is defined by the URI specification, not CGI. Also, when two separate ideas use some of the same standards, it doesn't mean the ideas are equivalent. Otherwise, I'm sure you could logically argue that Java and PHP are the same thing.
PHP can run as a CGI or as an Apache module (and in a few other environments). There is a substantial performance difference between the two.