I figured it out.
Normally, the mail on the server will be deleted after you do 'Compact' on your 'Inbox'-folder.
As an IMAP-newbie, I thought it would be a good idea to activate the IMAP option 'When inactive, disconnect after ... seconds' in combination with 'Connect to the Server' ; 'to load contents of a message or do another action'.
But 'Compact' will not trigger TB to connect to the server and so the compacting will be performed while there is no connection with the server. This caused my problem.
I've set option 'Connect to the Server' ; 'when the account is selected' and deactivated the option 'When inactive, disconnect after ... seconds', (which are, in fact, the default settings of TB, mind you),

and now when I compact the inbox, there
will be a connection to the server and the deleted messages will also be deleted on the server.