Essentially, here's what's happening:
When you visit a website you are actually passing an instruction to the server in the form of a URL. The purpose of the server is to, well, serve you data and exactly how it does this depends on the server technology you are using (examples include Apache, IIS, nginx, and GWS). Keep in that this is meant literally, the server has no concept of HTML, images, or flash - its job is to figure out what you mean when you go to http://example.com/home and then send information to the client (ie, you).
Now, you interface with the server by using a server-side language such as PHP. When the server determines that you need to load index.php, it loads the PHP module to work on index.php. This is where the "language" takes over to do as you say "process data" and "produce the output".
Notice when I said the server "loads the PHP module"; you can really have it load any module/language whatsoever, be it C++, JavaScript, QBasic, Ti-83+, the language used to power my microwave...it doesn’t matter. If no modules/languages were loaded to process the file, the server would simply spit out index.php in it’s raw form - which wouldn’t look pretty.
Now the client (the browser) only understands HTML, CSS, and JavaScript so it is the responsibility of the server and the language to work together to process a .php file (for example) into functional HTML file that your browser can work with. This relationship between the server and language is called a Server Stack, and several exist:
* LAMP - an Apache server that uses the PHP language
* Ruby on Rails - typically a Mongrel server that uses the Ruby language
* NodeJS - You actually build the server yourself using JavaScript, and then use JavaScript to process the data.
So as you can see you do NOT need PHP.