A database is a structured way of storing information on a server, so the data is easily accessed and manipulated as needed. Most databases use a database management system (DBMS) that allows users to interact with the data.
Data storage usually occurs on the back-end. Even if some of the data is replicated and stored in front-end files, it usually has a server-side backup. You do not want users, benign or malicious, to alter your data.
Static files transfer to the client, meaning the user can see all that data. That may be okay for a company logo or a blog article, but it is not okay for private data. Server files and databases store back-end data. Generally, databases provide higher security than server files.
It is also much more efficient to use a database for large or complicated sets of data. When working with large amounts of data or complicated data structures, databases are the way to go.
Databases are most commonly characterized as SQL (Structured Query Language) or NoSQL.