A transaction is a group of related steps that a database treats as one piece of work. The steps either all take effect, or the database can undo them if something goes wrong.
For example, moving money between two accounts needs to subtract it from one and add it to the other. If only one step happened, the records would not match. A transaction keeps the pair together.
Transactions help protect information from partial updates. They do not decide whether the requested change is correct; the app still needs to check that before saving it.
