A mail server is the computerized equivalent of the mailman. Every email that is sent passes through a series of mail servers along its way to its intended recipient. Without this series of mail servers, you would only be able to send emails to people whose email address domains matched your own - i.e., you could only send messages from one example.com account to another example.com account.
Mail servers can be broken down into two main categories: outgoing mail servers and incoming mail servers. Outgoing mail servers are known as SMTP, or Simple Mail Transfer Protocol, servers. Incoming mail servers come in two main varieties. POP3, or Post Office Protocol, version 3, servers are best known for storing sent and received messages on PCs' local hard drives. IMAP, or Internet Message Access Protocol, servers always store copies of messages on servers. Many people use web-based email clients, like Yahoo Mail and Gmail.
Those who require a lot more space - especially businesses - often have to invest in their own servers. That means that they also have to have a way of receiving and transmitting emails, which means that they need to set up their own mail servers. To that end, programs like Postfix and Microsoft Exchange are two of the most popular options. Such programs facilitate the preceding process behind the scenes. Those who send and receive messages across those mail servers, of course, generally only see the "send" and "receive" parts of the process.