Each unique prefix is first checked against any matching redirects and this information is stored in a list. Only if there are matches then redirects are checked.
The internal, non-aliases path is checked, which means that this is incompatible with ongoing issues that would allow redirects on aliases.
It is possible to disable this feature with $settings['redirect_use_prefix_list'] = TRUE;, this setting may be removed in the future.
Additionally, since there may be a very large number of unique prefixes being accessed, the list size is limited to 100 entries by default. This can be adjusted with the following setting: (This has been removed in the follow-up #3578648: Change prefix list cache to their own distinct cache entries instead as the cache is no longer a single bootstrap bin cache collector but distinct data cache entries)$settings['redirect_prefix_list_max'] = 200;