Drupal core has some modules to handle media files, such as the Image module (Drupal 7) and the Media module (Drupal 8). Other modules handling media are third-party modules.
Since Drupal 7, Drupal core has a module to display and manipulate images, the Image module, which defines an image field to use with entities. It also includes the code that on Drupal 6 was part of a third-party module, the ImageCache module, which allows to define presets, derivatives of the original image.
Since Drupal 8.4.x, Drupal core includes the Media module, which was a Drupal 7 third-party module, the Media module.
Other modules handling media files are developed as third-party modules.