“Not matching would mean the system created or lost money out of nothing.”
Double-entry bookkeeping is 500 years old and still the best way to track money. Every debit has a matching credit. Developers keep building payment systems with a balance column and a prayer. Then they reinvent the ledger after the first missing dollar.