This provides three important types of security. First, others cannot duplicate the hash without knowing the password. This provides authentication. Second, others cannot replay the hash—it is dependent on the unpredictable challenge. This is variously called freshness or replay prevention. Third, observers do not learn the password. This is called secrecy. The two important features of this protocol that provide these three security benefits are the one-way hash and the fresh random challenge.
CRAM-MD5 was originally defined in RFC 2095, later obsoleted by RFC 2195. In practice it's the only allowed and supported SASL-mechanism for ESMTPA without Transport Layer Security (TLS). CRAM-MD5 is required for On-Demand Mail Relay (ODMR) defined in RFC 2645. The also often supported SASL-mechanism plain for ESMTPA is officially not allowed outside of secure connections (TLS, the successor of SSL), and mechanism login is no SASL-mechanism at all - both transport unencrypted passwords. They scramble the passwords with Base64 encoding. Since Base64 is not one-way, there is no secrecy.
The Internet Assigned Numbers Authority (IANA) maintains two registries relevant for CRAM-MD5:
ESMTPA stands for ESMTP with SMTP-AUTH, and ESMTP is SMTP with Service Extensions as defined in RFC 2821. ESMTPS is ESMTP over a secure connection. ESMTPSA is both ESMTPA and ESMTPS - that's a constellation where SASL-mechanism plain is allowed.
John Klensin was the editor or co-author of (among many others) RFCs 2095, 2195, 2476, 2645, 2821, and 4409.