In the case of the blockchain, the decentralized database is maintained through a process called consensus, in which the nodes in the network agree on the state of the database and the order of transactions. ChatGPT teaches well.