Deletion in one folder doesn't delete in all folders

When I delete an email in one of my folders, it doesn’t delete it in the all email folder. I use iMAP. Shouldn’t it get deleted everywhere when I delete it in the folder for that particular email? Is there a setting I need to change?