When the button is clicked, it sends a request with some Ghost post and member-related parameters to a custom Next.js server. The server then maps the post and member IDs and saves them to a Firestore database. To display them on the frontend, the theme also sends a GET request to the custom server and receives back some data containing member names and avatars.