A Git commit object does not contain every file directly. It points to a tree that represents the repository root and to zero or more parent commits that connect it to history.
The commit's content determines its object ID, so changes to the tree, parents or metadata produce a different commit. Loading a commit snapshot may require traversing many tree and blob objects.
ELI5
A Git commit object records one repository snapshot by pointing to a root tree, earlier parent commits and metadata such as the author and message. It connects a project state to its history.
For example, changing a file produces a new tree and then a new commit that points to it and the previous commit. Any change to that content or metadata produces a different commit identifier.
