The way IMAP works, the messages are stored on a server. When you read a message on your computer, the message is copied on your computer so you can read it, but it stays on the server. The idea behind that is that you can check your messages from anywhere--a cell phone, your home computer, your work computer, whatever--and not lose any messages.
When you delete a message, you delete it from your computer. Whether or not that deletes it from the server depends on your mail settings. In Mail.app, go to Mail Preferences, click Accounts, click the IMAP account, and then hit Mailbox Behaviors. There are a bunch of options there for what to do with a mail message you delete.
If you turn on "Store deleted messages on the server," messages you delete will only be removed from your computer; they will stay on the server, ready to re-appear again. You might use this option for, say, an iPad or iPhone, where oyu don't want to delete the messages forever (because you want them to be on your desktop system) but you don't want them filling up limited storage space on the iPad or iPhone.
If you turn on "Move deleted messages to the Trash mailbox," it will make a folder called Trash on the server and put them there. They won't actually be removed, but they won't be in your inbox either.
If you want them to disappear totally and forever when you delete them, choose the option "Permanently erase deleted messages when: quitting mail."