Container available by IP but not by name

Hello!
I ran 2 containers:

1.docker run -p 5432:5432 -e POSTGRES_PASSWORD=qwe -n postgres postgres

2.docker run -e PGADMIN_DEFAULT_EMAIL=qwe@qwe.qw -e PGADMIN_DEFAULT_PASSWORD=123 -e PGADMIN_LISTEN_PORT=4422 --expose 4422 -p 4422:4422 dpage/pgadmin4

When I tried to connect to postgres, I was surprised that I can connect from pgadmin to postgres by internal IP address, but can’t connect by container name postgres.

There is a ping screenshot: https://i.ibb.co/QX8TMq2/ping.png

IP address is correct:
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' postgres
172.17.0.6

Could someone explain, please, why the container available by IP but not available by name?

As a rule of thumb if you have two containers that rely on each other launch them using a docker-compose file and they can reach each other by their service names