Thunderbird only automatically runs filters on the inbox folder by default. But there is a little trick which will allow you to automatically run filters on all folders and subfolders, including the junk folder, the spam folder and other folders.
- Open the config editor. If you don't know how do do it, here's an instruction.
- Create a new string setting with the value mail.server.default.applyIncomingFilters and set it to true. Even if it seems odd, do not create a boolean setting, it has to be a string setting with the value true.