If you rename or delete a service in your compose file, its old container stays behind, still running and still using the port. --remove-orphans finds those leftovers.
The option removes containers for services that are not defined in the Compose file. Compose knows which containers belong to the project, so it can tell which ones no longer match the file.
docker compose down --remove-orphans
It works with up as well, which is handy if you do not want to stop everything:
docker compose up -d --remove-orphans
The scenario I have in mind: you rename the service web to app, run docker compose up -d, and get a warning about an orphan container while the old web container is still running. One of the two commands above removes it.
down without extra flags removes containers and networks, but not named volumes. The -v option is the one that removes named volumes declared in the file and anonymous volumes, so I would never add it out of habit, because it deletes data. Also check the container list with docker compose ps first if you share one project name between several folders, since an orphan from the point of view of one file could be a service you meant to keep.
Further reading: docker compose down, docker compose up