A container has different layers starting with Minimal Subset of OS topped by Container Filesystem topped by Application layer topped by Hosting layer. All these layers are read-only.
There is a top layer called Container Runtime layer which will be in a Read/Write state.
The data on Container Runtime layer is persistent only when the container is stopped/started . If a continer is deleted, this data will be lost forever. Also this data is isolated only to that continer and cannot be shared with other containers.
So lets look at better data persistance models to share data between different containers on a Host.
Volume is the storage created and managed by Docker. This means no containers can go beyond the boundaries of docker while working with volumes.
Bind Mount is the storage directly from file system of the host file. So if there is a malicious code deployed in a container, it can break the host by manipulating the host filesystem.
By now looking at color coding you should have understood that Volume is a better/safer way of storing and sharing data between containers. Let me show you by a demonstration.