The seven-time champion, who missed the tournament last year, was outplayed by Italian Camila Giorgi initially but fought back impressively to win 3-6 6-3 6-4 on Centre Court.
Having swept all before her in the last two years she played Wimbledon, in 2015 and 2016, American Williams has now extended her winning streak at the All England Club to 19 matches.
This is just her fourth tournament back since giving birth last September, and Williams is one win away from a 10th Wimbledon singles final appearance.
Williams will next face Germany’s Julia Goerges, the 13th seed, who reached her first grand slam semi-final with victory over Kiki Bertens.
The 29-year-old dropped the first set to Dutch 20th seed Bertens but fought back to win 3-6 7-5 6-1.
Angelique Kerber admitted nerves almost got the better of her after needing seven match points to see off Russian youngster Daria Kasatkina.
Kerber came out on top of a spectacular 25-shot rally to force the all-important match point number seven, and finally got the job done as Kasatkina netted a forehand, the German relieved to be a 6-3 7-5 winner.
“We both played at a really high level, starting from the first point,” Kerber said.
Kasatkina had Kerber scurrying and scrambling during some compelling rallies but ultimately a vulnerable serve, which offered up seven double faults, let her down.
Seeded 11th, Kerber seems to be approaching something close to her 2016 peak, when she won her two grand slam titles and reached the final at Wimbledon.
The 30-year-old slipped out of the world’s top 20 after a miserable 2017, but she has rediscovered her game this year.
“I’m looking forward now to playing the semis here,” Kerber added. “That is where I put my focus on right now, not about the results I had before. It’s just about the next match now.”
That next match will be against another 21-year-old in 12th seed Jelena Ostapenko, who won last year’s French Open.
Ostapenko roared into her first Wimbledon semi-final with a display of power-hitting against Dominika Cibulkova.
The Latvian struck 32 winners to just six from her opponent, with Cibulkova’s second serve taking a pummelling, and won 7-5 6-4 in an hour and 22 minutes.
“I knew I had to be aggressive otherwise she would have opportunity for winners so I just went for my shots,” Ostapenko said.
“Angelique is a great player, it’s going to be a battle, a tough match probably with long rallies, but I will prepare well and be confident.”
The 23-time grand slam champion is playing only her fourth tournament since giving birth to daughter Olympia in September.
Williams was elevated to a seeding of 25th for this fortnight despite slipping down the rankings as a result of maternity leave.
But her current position at 181st in the world makes the American the lowest-ranked Wimbledon quarter-finalist in the open era, the International Tennis Federation said.
She took just an hour and two minutes to swat aside fellow tennis mum Evgeniya Rodina 6-2 6-2 on Centre Court.
"I always play everyone at their greatest. So I have to be greater"— Wimbledon (@Wimbledon) July 8, 2018
Top seeds have been scattered, but @serenawilliams remains. And she's ready for the second week... #Wimbledon pic.twitter.com/d5cV6BoCJd
With all top 10 women’s seeds now out of the championships, Williams is hot favourite to win an eighth title at the All England Club.
“On both sides, the men’s and women’s, there have been a tremendous amount of upsets,” said the 36-year-old.
“I don’t think this has happened to this extreme. But also I’ve never been ranked where I am when this has happened before, so usually I’m one of those few seeds left that’s still fighting and still in the tournament.
“I have a long way to go. I’m only in the quarter-finals. It’s not about wrapping up a win. It’s like all the other women that are still in the draw. Each of us, seeded or not, we’re just here to do our best.”
Rodina has a five-year-old called Anna, yet with so few women returning to tennis after having children a meeting of two mothers in the fourth round of a grand slam was a rare occurrence.
Olympia has begun to walk but Williams revealed she does not want her daughter to follow in her footsteps.
“I would hope she doesn’t play tennis,” she said.
“It’s a lot of work. A lot. Plus I don’t want her to have pressure from what I did, people talking about ‘are you going to be able to do as good as your mom?’
“I don’t want her to have that.”
The defending champion made it 32 straight sets won at the All England Club with a 6-0 7-5 6-4 victory over Adrian Mannarino to reach the last eight for the 16th time.
The last time he won as many consecutive sets was in 2005 and 2006, at the height of his dominance.
Federer said: “I feel like these streaks just happen. You can’t plan for them anyway because one point can change the outcome of a set. Of course, if you give yourself maximum chances, you’re playing well, you have super focus, then these streaks are kind of possible.
“I’m equally happy if I would have won all the matches in four sets. That it happened to be in straights, it helps me for the season, to save energy, it helps me to save energy for the rest of the tournament.
“I don’t think it’s something anybody aims for, to win every match in straight sets. It’s like today, I hope I get off to a good start, go from there. If it happens, it happens. It shouldn’t be a shock, and, ‘Oh, my God, I can’t believe it, I lost a set’. It’s part of what a tennis match is about.”
Even by Federer’s stratospheric standards, the first set was a little absurd. Of the five points he lost in the 16-minute opener, three were in the final game, when he faced his first break point of the tournament – and answered it with an ace.
After that things became a little trickier, and Federer was in danger of losing a set when Mannarino had three break points in the eighth game of the third set. But Federer saved all of them before breaking and serving out the victory to love.
The first set was so one-sided that, when Mannarino trailed 0-40 in the opening game of the second, the normally pro-federer Centre Court crowd began to cheer loudly for his opponent.
It had the potential to be embarrassing, particularly given Mannarino is a top-30 player, but the Frenchman composed himself well to make a match of it.
Federer said: “I told my team the other day that for me also, after all these years, it is surprising to be the number one seed, in the top two in the rankings at 36. I didn’t think that was ever going to happen.
“That sometimes there is a set like this against a player who is not the biggest server, it can happen. Then he showed that he is top 30 after all, he played two good sets after that.
“I was also surprised it was that fast, that first set, especially 16 minutes. That was too fast. Shouldn’t really happen, but thankfully they do for me. I probably won’t have another 6-0 set this week, so I’ll enjoy this one.”