404 errors are handled browser site and has nothing to do with WordPress. When nothing is returned from the request, the browser triggers a 404 action and displays a 404 not found error page
By default, if no custom 404 page exists on the site, the browser will display its own default 404 page.
For further reading, check out: Creating an Error 404 page