DKIM and SPF are tools that ISPs use to verify that emails are legitimate and prevent forgery. Although neither is explicitly required, having them significantly improves your emails' deliverability. And if you use an outside email provider like SendGrid, usually DKIM and SPF are necessary for whitelabeling your domain.
DKIM is used to prove that the domain that the email is coming from is actually allowed to send those emails. The sender of the email publishes a private key and the domain owner publishes a public key in their DNS. When combined, they authenticate the sender's ability to send emails from the specified domain.
If the domain that the email comes from doesn't match up with the DKIM record, many email providers will put an "on behalf of XXX" note next to the senders name. I know for a fact Gmail and Hotmail both do this.
Sender Policy Framework is another DNS record that helps prevent forgery. The domain owner publishes a list of outgoing mail servers that are allowed to send on its behalf. If they don't match up, the message is typically marked as spam.