Photos stores all of the photos and information about your photo collection in a Photos library. When viewing a Photos library in the Finder, it appears as a single icon, known as a package, but in reality, that package contains a whole hierarchy of folders and files inside of it. When you import photos into Photos, they are copied by Photos into the library package, and Photos takes care of organizing them within that library and keeping track of where they are. Photos also creates a handful of its own data files in the library along with the photos themselves. These files contain information such as how you have your photos organized into albums, the title, favorites, keywords, and other information you assign to your photos, and much more.
A Photos library is a self-contained unit, so all the photos and related data are all stored within that one library package. This means that you can backup, move, or copy the library by simply copying or moving the library package using the Finder, just like you would copy any other file or folder.
Typically, while working with Photos, it keeps all the details of the library package hidden from you. You can just use Photos’ interface to manage your photos, and you never even need to look inside the Photos library package itself. However, in some cases, especially if you encounter problems with your Photos library, in can be useful to know a little bit more about what goes on inside the library. If you wish to delve into the library package’s contents, you can do so by control-clicking on it in the Finder and selecting “Show Package Contents” from the contextual menu. If you choose to do so though, do not move, rename, or delete any items within the library package. Altering the library contents in this manner can cause Photos to become very confused, and thus is not recommended.