In more detail
Receivers compare the connecting server's IP address with the list in the envelope sender's domain and treat mail from other sources according to the ending (-all fail, ~all soft fail). A record may cause at most 10 DNS lookups, and a domain must have only one. SPF alone does not protect the visible From address: that takes DMARC.