In everyday life
A file is like one whiteboard: whoever wipes it and rewrites it last wins. A database is like a bank teller who updates one account at a time and refuses a slip with no signature.
One case
A clinic keeps its appointments in one shared spreadsheet. At 09:02 two receptionists save it within seconds of each other, and the second save wipes out the 3 bookings the first one just added. The next morning, 3 patients arrive for appointments the clinic has no record of.
A program that keeps state on disk in tables, answers questions about it fast, and refuses data that breaks its rules.
Every case
A file is saved whole, so the last save replaces everything. A database stores each record as its own rowOne record in a database table, such as one order. Columns are its fields. and changes only the rows a write touches, so two people who edit different appointments do not erase each other. For two writes to the same row, it offers transactions, locks and one-step updates; used well, they stop one change from silently erasing the other. It also checks every write against rules: this fieldOne named value inside a record, such as the total of an order. is a time, this id is unique, this booking points to a real patient.
The word
Engineers call this
Put shared, important state in a database, and let the database enforce every rule you can state.