Any domain that uses email has MX (Mail eXchanger) records.  The MX record lists the various mail servers available to accept mail for that domain.  Lets use as an example.

The domain has two MX records (these are just an example and are not actual MX records):

Domain  TTL  Type  Priority  Server  3250  IN  MX  10  3250  IN  MX  20

The priority determines which record should be used first, starting with the lowest (e.g. 10 will be used before 20).  If that is not available then next server is contacted and so on.  You can use MX records of equal priority to allow both servers to be used equally, this is useful if you are using a SpamTitan cluster as it will distribute mail evenly between your servers.

This MX record tells us that if you want to send mail to you first contact, and if it is not available the use is an A record which resolves a name to an IP address:

FQDN  TTL  Type  IP address  8488  IN  A

We now have an IP address that we can use to contact the mail server directly and deliver email for  

So the sequence is:

MX Record-> A Record-> IP Address