Delaware requires every corporation to keep a stock ledger, the official record of its stockholders and their shares (section 224). It is the legal answer to the question of who owns the company, and under section 219 it is the only evidence of who may vote at a stockholder meeting.
A cap table is the summary people actually read: who holds what, by class, including options, warrants, SAFEs and notes, with ownership shown on an outstanding and a fully diluted basis. The cap table should be derivable from the ledger and the agreements behind it, and when they disagree, the ledger and the signed documents win.

What changes it
Update the ledger and the cap table on the day anything changes: when stock is issued to a founder, an employee or an investor; when options are granted, exercised, canceled or expire; when SAFEs or notes are issued, converted or repaid; when a stockholder transfers shares after the company waives or exercises its right of first refusal; when the company repurchases shares, such as a departing founder's unvested stock; and when the charter is amended to split or combine shares. Each entry should point to the documents behind it, which means the board approval, the signed agreement and proof of payment.
What diligence will ask for
When you raise a priced round or sell the company, the other side's lawyers reconcile your cap table with your documents, line by line. They will ask for every stock purchase agreement, option grant and exercise notice, with the board and stockholder approvals for each; proof of payment for every stock purchase; the 83(b) elections and proof of filing for restricted stock; 409A valuations covering every option grant date; every SAFE and note, with side letters; and every transfer, with the company's waiver of its right of first refusal. Gaps found in diligence are fixed under deadline, usually at the company's expense. Gaps you find yourself, earlier, are cheap.
The usual mistakes
The same errors come up again and again. A founder promises an advisor half a percent in an email and nobody ever grants it, so the promise floats with no paper behind it; either grant it properly or put it in a written contract. Options are granted without a current 409A valuation, or before the board approved them. Offer letters state percentages instead of share counts, which leaves it unclear what was promised. Transfers and repurchases go unrecorded, so the ledger still shows a former founder owning shares the company bought back. And SAFEs are left off the cap table because they are "not stock yet," which hides the dilution they will cause.
Corply builds each company's stock ledger and cap table from the same records that produce its documents, so issuances, repurchases and SAFEs appear when they are signed.