If I type "Tell me the history of the Roman empire" into an #AI chat bot like #ChatGPT and hit return, it HTTP POSTs that to one of their web servers, and then ... what?

How many computers are involved in producing my response? What are their responsibilities? How is the response assembled from those parts?

It's a bit like the old interview question: if I type "cnn.com into a browser, what exactly happens?" I can answer that one, but I'm unclear on the AI chat version. Anybody know?