The mailserver handles email, both incoming (POP3 and IMAP) and outgoing (SMTP), and is usually located on the same machine (server) that handles web hosting.
POP3 (Post Office Protocol Version 3). For example, if you set up your email account in POP3, then the emails after being downloaded to your computer will be deleted from the server.
IMAP (Internet Message Access Protocol). In case you set up your email account in IMAP, then after you download your emails locally, they will remain on the server. This serves users who have their email account set up on more than one device (e.g. mobile, tablet, laptop).