Historically, the html anchor link for mailto was used to launch a new email message from a locally installed mail client such as Outlook, Thunderbird, Lotus Notes, or many of the other competing products. With the rise of webmail at the end of the 1990s with services such as Hotmail, Yahoo mail, and later Gmail, people now wanted the links to open a website on the browser.
Once browsers were programmed to handle the mailto link all you needed to do was set the handler for this type to be the browser and let it do the the rest.