You put a file on your server and requesting it returns HTTP "200 OK" status and whatever HTML content the file "contains" (for .html files) or whatever HTML content the file "generates" (for .php files).
Even if the file contains no content and generates no content the returned status will still be "200 OK", because a file was found in the server filesystem to fulfill the HTTP request. (You'd only get a server-generated 404 status if a file was NOT found in the filesystem.)
When the file contains PHP scripts to generate content based on the requested URL and there is no content in there for the current requested URL, the script must return a 404 status by using the HEADER directive.
The script should also send some sort of error message to the user to inform them as to what is happening. The usual way to do this is to INCLUDE() the contents of the 404 error message file.
The HEADER directive is vital here. Without it, the user would have a HTTP "200 OK" response returned along with an HTML page saying "404 Not Found". The information in the HTTP header is what searchengines need to see. Returning "200 OK" would be a major disaster.