Often, when parsing, you encounter a point where you want to check if a string is one out of a set, as quickly as possible. E.g., if you are parsing URLs, the string must start with a protocol, and there is a finite list of protocols. There are many such problems. Think about YAML files where a parameter must take one out of 3 or 5 values.
If you have 5 strings (say http:, https:, file:, sftp:, ftp:), you may do 5 comparisons. This is obviously wasteful.