The referenced docs page referenced by @Mizső I believe does explain the difference of detected errors and how to configure them if they don’t meet your need.
For example reading the explanation tells me that 500-5xx will always be interpreted as a server error. So 5xx metrics.rate is a server error while 400-4xx (yes there is a typo on that page) is a client error.
Then it also says that missing HTTP response code as client-side errors or server-side. So my naiv assumption is that 4xx is everything from 400-4xx while client side or then server-side (500-5xx), respectively can be more than just the actual 4xx or 5xx errors. E.g. when you also take missing response codes into account.
Answer to
What is the difference between client-side errors and HTTP 4xx errors?
Likewise, how can I distinguish HTTP 5xx errors from server-side errors?
Id therefore say yes to
Are the HTTP 4xx errors part of the client-side errors, and are HTTP 5xx errors part of server-side errors?
And yes to:
Is the metric “Failure rate (any errors)” then the error rate when considering all 4 error categories (HTTP 4xx, HTTP 5xx, client and server errors)?