Stops the currently running Shiny app, returning control to the caller of ‘runApp’.
What the code snippet is telling R to do is: "When a user stops their session, kill the whole Shiny app". (Which would stop all other user sessions.) A single app can support many user sessions simultaneously.
This is equivalent to hitting ctrl + c or Esc in RStudio.