What is the difference between 'failed' and 'refused' message statistics?

refused messages are those rejected for an 'expected' reason: for example, due to a defect in the request such as a malformed message, or a rate limit, or the client lacking the correct permissions.

failed messages are those rejected for an 'unexpected' reason: either due to a service issue on our side, or the message being rejected by the external target in the case of a Reactor or Push message. (Note that since we can't distinguish between expected and unexpected reasons from external sources, all rejections from external systems such as Reactor targets will show up as failed stats in the relevant stats section.)