Git has format dedicated for storing snapshots of trees and diffing them, fossil just uses SQLite and few tricks to keep size small