What is a directed acyclic graph in cryptocurrency? How does DAG work?

A simple guide to explain what a directed acyclic graph (DAG) is in cryptocurrencies, how it is used and how it works.