The 47-year-old Welshman recorded the third maximum of his career in the fourth frame of the match, having lost the opening three while compiling just 17 points.
Williams made his first competitive 147 break against Robert Milkins at the 2005 World Championship, and his second at a minor event in 2010. It is already the seventh maximum break of the season.
It was not enough for Williams who fell short in a high-quality contest that featured a total of four centuries and a break of at least 67 in every frame.
Robertson started by leaving his opponent in his chair with successive breaks of 73, 97 and 100, then responded to Williams' historic maximum with a break of 102 to re-establish his three-frame lead at 4-1.
Williams won the next two with breaks of 67 and 123 before Robertson's third century, a 127, got the Australian over the line.
"There were hardly any unforced errors, both of us were really clinical," Robertson told World Snooker Tour.
"It was a brilliant match and capped off by Mark's 147. It was an amazing break, nearly perfect all the way."
Robertson will face Mark Selby in the semi-finals after the former world number one beat Ali Carter by the same score.
Selby goes into that clash as the highest ranking player left in the field, after world number two Judd Trump followed Ronnie O'Sullivan out of the tournament with a shock 5-1 defeat at the hands of Luca Brecel.
The Belgian took a 4-0 lead, peaking with a break of 135, and saw off a brief revival from his opponent after the break to close out victory.
"It was amazing to beat Judd like that, I didn't expect it but it always nice," he said.
"Judd is an unbelievable player, he could easily win three frames in one visit and 25 minutes. But I was calm, you have to not panic. You don't realise you're playing that well, it's only after the game when everyone tells you."
Mark Allen enjoyed serene progress, strolling to a 5-0 sweep over Ashley Hugill.