Gmail configured it for you. This is implemented as an API[0] that can be called from a site's javascript code, like this:
navigator.registerProtocolHandler("mailto", "https://webmail.example.com/handler=%s")
[0] https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler