Linux firewall, aka netfilter, is a list of packet match rules. If a packet matches the criteria of a rule, then the rule performs an action (such as write details to a log file).
The easiest criteria is "match all", but one can narrow that down to "match all TCP packets".
Programs like SNORT can do more -- to look into the payload (content of the packet) in addition to address, etc that the netfilter focuses on.