Tags are used to mark services for certain purposes. Various services use this tag in order to discover services. An example of this is how file streams are used. For example, the public:// stream is defined with:
stream_wrapper.public:
class: Drupal\Core\StreamWrapper\PublicStream
tags:
{ name: stream_wrapper, scheme: public }
To add another file stream to Drupal you would create a service that implemented Drupal\Core\StreamWrapper\StreamWrapperInterface and then add the stream_wrapper tag to it, along with defining the scheme.