docker compose down removes containers and networks and leaves the images behind. An option takes the images along.
This deletes images, so the next up has to build or pull them again.
docker compose down --rmi local
The Docker docs describe --rmi as removing the images used by services. The value local removes only images that do not have a custom tag, and all removes every image the services use.
By default down only removes the containers of the services in the Compose file, the networks defined in it and the default network if one is used. Networks and volumes defined as external are never removed. Anonymous volumes also stay, and since they have no stable name a later up does not mount them again.
Volumes are a separate flag, -v or --volumes. It removes the named volumes declared in the Compose file plus the anonymous volumes attached to containers, which means data is gone for good:
docker compose down -v
I keep that one out of anything I type from memory. To see what went, run docker compose images before and docker image ls after. An image that carries your own tag counts as custom and stays with local.
Further reading: Docker docs: docker compose down