Thunderbird's message filters (Tools → Message Filters…) seem to only fire on Inbox automatically. If you want to filter on subfolders, you'd have to start this filter manually (Tools → Run Filters on Folder).
How can I filter mails in subfolders automatically, too?
I found the (now EOL'ed) extension Filter Sub Folders. There it says:
It turns out that there's already functionality to do filtering on sub folders in Thunderbird, it's just not well documented (indeed, it's barely documented at all). It can be enabled by setting the preference "
mail.server.default.applyIncomingFilters" to true, or can be applied per folder by setting the "
applyIncomingFilters" property to a folder.
I searched for the property
mail.server.default.applyIncomingFilters, but didn't find it. So I added it (as string, according to this issue) and set its value to
true. But this didn't work. After restarting TB the mails in subfolders didn't get filtered.
FilterQuilla (https://addons.mozilla.org/en-us/thunderbird/addon/filtaquilla/) is reported to be able to set that property, although I haven't tested it.
It doesn't say anything about that in the description.
Similar (but not same) question: How can I get Thunderbird to automatically move messages?
See also (useful to have it combination): How can I get Thunderbird to check subfolders on IMAP?