In Mail.app, go to Mail Preferences, click Accounts, click the IMAP account, and then hit Mailbox Behaviors. Whether or not that deletes it from the server depends on your mail settings. When you delete a message, you delete it from your computer.
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 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 way IMAP works, the messages are stored on a server.