How do priorities work in the *.services.yml YAML file? In system.services.yml and many other services files, one can find priorities like this:

services:

  ...

  path_processor.files:
    class: Drupal\system\PathProcessor\PathProcessorFiles
    tags:
      - { name: path_processor_inbound, priority: 200 }

  ...


Are these priorities similar to the weight-system we know from Drupal 7, where a low weight means earlier in the processing order. Or do priorities work the other way around, where the items with the highest priority are processed first?

I am asking because I could not find a source explaining this.
Drupal uses the EventDispatcher from Symfony and there the priority is used to control in which order the event listeners are triggered:


  An optional priority integer (higher equals more important and
  therefore that the listener will be triggered earlier) that determines
  when a listener is triggered versus other listeners (defaults to 0).
  If two listeners have the same priority, they are executed in the
  order that they were added to the dispatcher.


So the priority in D8 is exactly the opposite of the weight in D7.

The example you used in the question is not an event subscriber, but it uses the same concept of priorities.