The primary server works by using a combination of SMTP (Simple Mail Transfer Protocol) to send emails and IMAP or POP3 protocols to receive emails. When you send an email, the primary server processes it and delivers it to the recipient's email server. It also stores incoming emails and makes them accessible to users.