Error Pages
Explanation
The screen a reader gets when a page, an attachment or an entire wiki does not exist, or when access is denied, comes from a Velocity template: three of them are shipped with the web application, and the missing-page one with the Flamingo skin. Each of the four looks for a wiki page of its own first and includes it when it exists, so the screen can be replaced without touching the skin. None of those four pages ships, which is why a new instance always shows the standard screen.
Customize an Error Page gives the four page names, the wiki each one has to be created in, and the HTTP status of each case.
Why a wiki page rather than the template
Editing the templates works, but they belong to two different artifacts (the missing-page one to the skin, the other three to the web application), so every upgrade brings new versions of them to merge. A wiki page is yours: an upgrade has nothing to merge into it.
What a custom page takes away
The template includes your page instead of its standard block, not in addition to it. On a missing page, that block is more than a message:

A custom XWiki.DocumentDoesNotExist therefore also removes the "edit this page" link that lets a reader create the page, the suggestions of similar pages (contributed by a shipped user interface extension that hands the search over to the search engine, Solr on a standard instance), and the list of matching pages waiting in the recycle bin. The same holds for the other cases: a custom attachment page drops the extensions contributed to that screen, and a custom access-denied page drops both the underlying error and the distinction between "this wiki is read-only" and "you are not allowed". Whatever of that your readers need, your page has to offer itself.
One page for two situations
XWiki.DocumentDoesNotExist answers both the reader who opens a page that does not exist and the far rarer case of a Velocity template that cannot be evaluated. The second is an internal error rather than a missing page, so a message written only for readers looking for content reads oddly there.
FAQ
Will the page show up in the wiki like any other?
Yes: each of the four is an ordinary page of the XWiki space, listed and searchable. Mark it hidden if you would rather readers did not come across it on its own.
More
To find more about the current topic, you can search or use the table below and filter the columns to narrow your choices.