WASHINGTON—Nancy Pelosi is ending the first year of her second stint as House speaker with more support from her caucus and outside liberal groups than she started with, ironically because of how she handled a task she long resisted.

Mrs. Pelosi, the highest-ranking woman in American political history who has led her party for nearly two decades, began 2019 by narrowly retaking the gavel amid grumbles from some quarters that Democrats needed new leadership. She fended off calls to impeach President Trump, saying she wanted...