The problem in one example
Transfer 500 rupees from account A to account B.
UPDATE accounts SET balance = balance - 500 WHERE acc_id = 'A';
UPDATE accounts SET balance = balance + 500 WHERE acc_id = 'B';
Two statements. The power goes off between them. A has lost 500 rupees and B never received it. The money is gone from the universe.
A transaction is the fix. It wraps several statements so that either all of them happen or none of them do.
START TRANSACTION;
UPDATE accounts SET balance = balance - 500 WHERE acc_id = 'A';
UPDATE accounts SET balance = balance + 500 WHERE acc_id = 'B';
COMMIT;