In what proved to be the match of the tournament so far, the world champion put on a clinic in the early legs, converting 127 and 125 checkouts before firing in a brace of 11-darters.
Wright was cruising at 7-3 but Ratajski rallied and reeled off four straight legs to tie the match at seven legs apiece.
A subsequent 10-darter from Wright was followed by back-to-back Ratajski 180s as he stormed to a 12-dart riposte.
As the pressure mounted, both men missed key darts at double before exchanging holds. Nevertheless, it was Wright who kept his cool as the Scot fired in yet another 11-darter before closing out the 13-11 victory with a double 10.
"I really enjoyed it," said Wright, who averaged 103.5 and landed ten 180s to set up a last eight showdown against Dimitri Van den Bergh, in a repeat of last year's final.
"You need to be in matches like that sometimes to see where you are. That has definitely got me ready for Dimitri now.
"Dimitri is playing really well. He has won two World Series titles recently, he's taken his game to the next level, so it should be another tight game. Bring it on!"
Elsewhere, Michael van Gerwen took a step towards his third World Matchplay title after beating Joe Cullen.
The Dutchman averaged 111 in the early stages of the match as he powered to an 4-1 lead.
Four consecutive 180s were traded by both men in the next leg, while Cullen cut the deficit by producing a 12-darter.
Nevertheless, Van Gerwen won seven of the final nine legs to seal the 11-5 success.
"I was on a mission. I started off really well and that gave me a lot of confidence," said the three-time World Champion.
"I'm still not 100%, everybody knows that, but even when I'm at 90%, I can beat everybody in this tournament.
"This is one of the most important tournaments of the year. You want to perform here, and I'm so glad to be in the quarter-finals."
Tuesday's World Matchplay results
Dimitri Van den Bergh 11-6 Rowby-John Rodriguez
Nathan Aspinall 11-9 James Wade
Peter Wright 13-11 Krzysztof Ratajski
Michael van Gerwen 11-5 Joe Cullen