With DKIM the sending mail server encrypts the e-mails body and headers and appends the encrypted hash to the e-mail header (DKIM-Signature).
Mail-Server - Blog
SPF (Sender Policy Framework) tells the receiving mail server whether the sending mail server is allowed to send e-mails with the domain of the sender email address.