A database is an organized collection of data that is stored and accessed electronically. For websites, it stores information such as user details, posts, and settings, which are required to run dynamic content.