Tables and Chains
https://en.wikibooks.org/wiki/Communication_Networks/IP_Tables
A simplified diagram focused on iptables is available at https://stuffphilwrites.com/2014/09/iptables-processing-flowchart/.
IP sets
ipset
expresses complex IP addresses and port based rulesets with one single iptables rule, making it very efficient compared to multiple iptable rules.