Answer: The mountain pine beetle, which is considered a threat to pine trees, is expanding into a new habitat
Explanation: The commas go around the additional information in the sentence in a way which ensures the sentence could still be read without them. If you took the section away, you would have "The mountain pine beetle is expanding into a new habitat."
So, commas go around non-essential clauses that add information.