Glossary: a gallery is a named group of assets that, unlike a folder, can be attached to content and components through a Gallery field.
A gallery is a named group of assets. Galleries are like folders, except that they can also be added to content and components through a Gallery field, so editors can pick a set of images as a media gallery.
Galleries are managed in the Assets section, on the Galleries tab. Your code reads a gallery's images from the Fetch API's gallery endpoint, using the gallery ID.