Generally when a user requests a page and if it doesn't exist then the server will return a 404 not found error as an output on the user screen. This error/response code informs the search engine that the current page request do not exist hence the search engine will not index and crawl that particular page.
As a result, the website will be safe from getting penalized.
One should always remember that returning a HTTP response code 404 page or 410 page (gone) is important for non existing page and skip the practice of redirecting the users from these responses to homepage or to any other page if you do that your site will get penalised and in result you will get a loss in page rank.
The reason behind is that, if you redirect a non-existing page to other pages, search engine thinks that there is a real page for the requested URL for which server respond the 404 error not found and search engine will crawl that page, Hence Google crawler will spend the much time on non existingURLl first and your unique url will not be indexed as frequently.
An another aspect of having a soft 404 error page is that, In a soft 404 error the server did return a page but it doesn't look like what a user prompted to see, but in-spite of that it creates a positive feeling within the mind of end user that his actual search end with a result which is highly related to the query which he/she was searching for. And as a result of which user still engaged with the website.