On startup, the application opens N connections. Each request takes a connection from the pool, uses it, and returns it. If all connections are busy, the request waits or receives a timeout error.
PHP-FPM + MySQL: each worker has its own pool. For centralised pooling across workers, use PgBouncer (PostgreSQL) or ProxySQL (MySQL).