Basically it just sends the current selection from the editor to ChatGTP and bundles it with a predefined query / question string. It displays the result to the side in a new window. It's not really rocket science, but it allows to easily interface with ChatGPT.