Things always go wrong, because DBs still run on fallible hardware, operating systems and networks.
What is a transaction?
A mechanism for simplifying this issue:
The application is free to ignore potential error scenarios and concurrency issues, because the DB takes care of them instead (called safety guarantees).
Weaker guarantees
Some apps can benefit from weakening transaction guarantees or abandoning them entirely for performance or higher availability reasons [this, this].
Atomicity, Consistency, Isolation, Durability: