Throughout Drupal and Symfony components, and even other third-party PHP libraries, events can be passed to the event dispatcher. The event_dispatcher service in Drupal is an optimized version of the one provided by Symfony, but is completely interoperable.
When the container is built, all services tagged as event_subscribers are gathered. They are then registered into the event_dispatcher service, keyed by the events returned in the getSubscribedEvents method.
When the event_dispatcher service is told to dispatch an event, it invokes the proper methods on all subscribed services. With KernelEvents::REQUEST, KernelEvents::EXCEPTION and KernelEvents::VIEW, you have the opportunity to provide a response before the controller is invoked. Then there are events, such as ConfigEvents::SAVE and ConfigEvents::DELETE, that are dispatched and allow you to react to a configuration being saved or deleted but are not actually able to adjust the configuration entity directly through the event object.