This is exactly the same concept as Thunderbird and Outlook smart folders. Gmail addresses this using labels which adds metadata to the IMAP messages. IMAP folders are not reliable to tag messages as having multiple tags essentially duplicates the message on the IMAP server.