When we commit changes into a snapshot, git saves the diff.
Each snapshot points to its parent.
And there are pointers pointing to the last commit.
So given any snapshot, we can trace the changes back to its root, first, snapshot.
It given any snapshot, we can construct the files by applying the diff patches from its root snapshot.
You can foresee from their mechanism that this design approach is good for source code and plain text files. It uses text patches to maintain the version changes.
But if we do version control with binary files, such as
.psd format, it needs to store the file for each commit.