The first argument is the context of the page from which to resolve relative paths, typically the current page.
The second argument is a path to a page, with or without a file extension, with or without an anchor. A path without a leading / is first resolved relative to the given context, then to the remainder of the site. Alternatively, provide an options map instead of a path.
By default, Hugo will throw an error and fail the build if it cannot resolve the path. You can change this to a warning in your site configuration, and specify a URL to return when the path cannot be resolved.