To put it simply, the "flag" does the same job as the "star" on WhatsApp; to let users pick specific messages that they feel like to revisit in the future.