How is spam handled via imap client?

How is spam handled via imap client?

How do I handle spam in Zoho via imap client?

Mark an email as spam --> move the email to spam folder.
Mark an email as not spam --> move the email to inbox.

Is that how it works?

On Zoho web an email that is marked as not spam gets filtered and relabeled as necessary. Do imap also follow same principle?

Regards,
Sudhir Khanger,
sudhirkhanger.com.