Before getting into your question, you will need to know how Kubernetes Pod works.
In Kubernetes, All the containers in the same Pod are scheduled in the same node. Inside the node, they are orchestrated with the container runtime.
Taking the docker runtime for simplicity, Kubernetes will spawn up two containers according to your configuration. One is the NGINX and one is the bash. In container orchestration, you can define a volume and share them across different container runtime. But behind the scene, they are using the same folders/files from the host machine.
So, circling back to your question, Kubernetes here created two containers in your hosting machine. And it also created a docker volume to share across these two containers. Inside the containers, the volume are mounted into different path but still share the same source of truth, which comes from the worker machine.
In case you want to know how it is going on your worker machine, you can ssh into your worker and run the following command.
# Get your container ID
> docker ps
# Inspect your container
> docker inspect <container>
And try to spot the volume part in the output. You should be able to see that they are sharing the volume.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…