Regarding the mismatch of email counts... not having IMAP folders synced will hide their counts from your client but not the mail server, since the
All Mail folder is generated by your mail provider it includes the emails in IMAP folders you haven't subscribed to. From the screenshot it appears you also don't have your
Spam folders synced. So that's another possible source of disparity in the counts.
Regarding the failure to delete emails. Well... that's not Thunderbird's fault. Thunderbird sends a message to the IMAP provider to remove the message from the folder... but it's up to the IMAP provider how it does so. In this case it appears that the IMAP provider is simply moving the email to the
Trash folder. This is actually really common and is typically seen as a useful feature. Most IMAP providers will also completely delete emails from the
Trash folder automatically when they have been in the trash more than a certain amount of time (usually something like 30 days)... meaning that you never have to empty the trash folder yourself. And, because your don't appear to have your
Trash folder synced... you only see this on the IMAP provider, not Thunderbird.
The solution to all of this is to simply subscribe to every IMAP folder.
There is, however, one last "gotcha". Thunderbird uses
Trash as the folder name for it's trash folder and
Spam for the folder name of it's spam folder. If your IMAP provider uses a different name then you will simply have to live with duplicate trash and/or spam folders... one managed by your client and the other managed by your IMAP provider. Many email clients provide a way to change what the default folders are named in the client. Thunderbird, afaik, is not one of those clients. There is a rather hacky way to do so, for the trash folder at least, intended for advanced users. If this turns out to be an issue and it is important to you, you may want to explore other email clients.