BEGIN…COMMIT groups writes into one atomic, ACID unit; ROLLBACK undoes it on failure.
Group several changes so they all happen or none do. If anything fails halfway, the database rewinds as if you never started.
It's what stops money disappearing between two accounts, and ACID is a guaranteed interview question.
A transaction wraps several writes in BEGIN … COMMIT so they take effect as one atomic unit: COMMIT makes them all permanent, ROLLBACK undoes them all. Transactions guarantee ACID — Atomicity, Consistency, Isolation, Durability. Isolation levels (Read Committed, Repeatable Read, Serializable) tune how much concurrent transactions see of each other, trading anomalies against throughput.
A transaction groups writes so they're all-or-nothing: BEGIN starts it, COMMIT makes every change permanent at once, ROLLBACK reverts them on any failure. It guarantees ACID. The classic example is a money transfer — debit A, credit B — which must never happen halfway. Isolation levels control what concurrent transactions observe.
Intro to ACID Database Transactions | Systems Design Interview: 0 to 1 with Google Software Engineer — Jordan has no life, 7:49