The domain publishes a TXT record with mechanisms and an "all" policy; the receiver evaluates the sender IP and applies the result.
The typical record starts with v=spf1 and chains mechanisms such as ip4, ip6, a, mx, include, and exists, closing with all, ~all, or -all. Evaluation is capped at 10 DNS lookups and 2 void lookups; exceeding either limit produces a PermError that invalidates authentication [1]. Domains with many senders often need flattening to stay within the limit.