Appium is a web server written in Node.js that exposes a REST API. It receives connections from a client, listens for commands, executes those commands on a mobile device, and responds with an HTTP response.
Client/server architecture opens up a lot of possibilities. we can write our test code in any language that has a http client API. We can put the Appium server on a different machine than our tests are running on.
So when you run your Appium scripts, it will communicate to Appium server using JSON wire protocol and then Appium server translate those commands and execute them on mobile device.