2xx means success, 3xx means redirect, 4xx means the request failed because of the client or a missing page, and 5xx means the server failed. Search engines index 200 pages, follow 301 redirects, drop 404 and 410 pages over time, and slow their crawling when they see many 5xx errors.
A page that shows an error message but returns 200 is a soft 404 and can confuse indexing. The code, not the page's wording, is what crawlers read.