Williams took an early break in the second set, with the 25-year-old Pegula clinging to tight holds of serve that kept her alive.
Pegula dug deep to save three championship points before Williams duly served out for the tournament, throwing her hands in the air before almost collapsing onto the court.
“I’ve been waiting two years for this moment,” Williams said, who returned to the tour in March 2018 after giving birth to Alexis Olympia Ohanian Jr.
“It feels good. It’s been a long time. You can see the relief on my face.”
Williams’ success means she has won a title in four different decades, and for the first time, her two-year-old was in the audience to watch her lift a trophy.
Draped in a korowai for winning the tournament and holding her daughter in one arm and the trophy in another, Williams beamed.
“I’m a little biased but she’s so cute,” Williams said.
Williams also announced she will donate her US$43,000 (A$62,300) winner’s cheque towards Australian bushfire relief.
While the 73rd title of Williams’ career is unlikely to feature in any career highlights, it is undoubtedly significant.
In defeating Pegula, Williams put to bed a five-final losing streak since her last title, the 2017 Australian Open.
That run includes four defeats in grand slam finals – twice at Wimbledon and the US Open.
The New Zealand win also means, for the first time, the 23-time major winner will arrive at Melbourne Park with a title already in the bag for the year.
Given her hardcourt form and record at Melbourne Park, where she is a seven-time champion, Williams might never get a better opportunity to win a coveted 24th grand slam than this month.
Another major for the legendary American would see her match the record held by Australian great Margaret Court.
Williams’ successful week in Auckland also included a 43-minute beatdown of world No.25 Amanda Anisimova in the semi-finals, and defeats of top-100 players Laura Siegemund, Christina McHale and Camila Giorgi.
Only McHale managed to take a set off Williams, who has also reached the final of the doubles event with Wozniacki.