Elasticsearch is a Web API, as explained here.
To get access to Elasticsearch from the php plugin code, we could have built our own http library, but it would have been crazy.
Instead, we are using the elasticsearch-php Elasticsearch client library. It is a low level code which takes care of wrapping/unwrapping php arrays to and from json over http. We used to use the Elastica library, but gave it up after the Elasticsearch 7.x version (see Elastica 7.x retro-compatibility issues)
If you want to learn more, here are some documentations: