How does Wolfram determine the plot bounds of a given function?

Anytime you plot a function in Wolfram, the “interesting” portion of the graph is shown to you in the final plot. How does Wolfram do this? What approaches/algorithms are used?

Please specify whether your question is about Wolfram Language or Wolfram Alpha.

Thank you