Why it matters
The sending server signs the message body and chosen header fields, always including the From header, with a private key. The receiving server reads the signing domain from the signature's "d=" tag and the selector from "s=", then looks up the public key in DNS at selector._domainkey.yourdomain. If the signature checks out, the domain in "d=" has taken responsibility for the message.
Gmail requires SPF or DKIM from every sender, and both from senders of more than 5,000 messages a day. DKIM also matters for DMARC, which needs SPF or DKIM to pass for a domain that matches the visible From address.
Example
A clinic using Google Workspace generates a DKIM key in the Admin console, choosing a 2048-bit key as Google recommends if the domain host supports it. It adds the TXT record at google._domainkey on its domain and turns on signing. Google says it can take up to 48 hours for DKIM to start working.