The difference should be simple to understand if you know what On my Mac means.
Folders that are under "On My Mac" are managed by you and reside on your mac, separated from any mail account you may have. If you delete a message that is on one of these folders, it goes to the "On My Mac" subfolder in the Trash.
Assuming your account uses IMAP (or Exchange, which works similarly), your messages and your mailboxes or folders are synced between your mac and your server.
So you move them to the trash they are also moved to the trash folder in your server (that is what the trash folder named after your ISP means). And if you actually delete them they will also be deleted in the server.