But there was never much sign of an upset in the Spanish capital, where the world number two opened up with a 6-3, 6-3 victory.
"Right now every victory is important for me because it gives me the option to play again the next day," Nadal said.
"Two weeks ago maybe playing again was not a chance to improve because I didn't feel like that in training.
"Now I am feeling better in matches and I think every one gives me the chance to get better."
Nadal has not arrived in Madrid without winning in either Monte Carlo or Barcelona since 2015 and, after also pulling out of Indian Wells due to a knee injury in March, concern was growing ahead of the French Open later this month.
The 32-year-old, who will be chasing his 18th Grand Slam title at Roland Garros, will now face another young talent in America's Frances Tiafoe, with either Stan Wawrinka or Kei Nishikori waiting in the quarter-finals.
"After Indian Wells, I had a big mental drop," Nadal said. "I had to stop for two weeks and mentally I dropped.
"I struggled a lot to get fit and recover that energy, which I now feel again."
Ferrer bowed out after losing to Zverev, calling time on a distinguished career that included 27 ATP titles and a highest ranking of number three in the world.
Renowned for his never-say-die attitude, the 37-year-old reached the French Open final in 2014, as well as five more Grand Slam semi-finals.
"I couldn't have given more to this sport," said Ferrer, who left his bandana on the 'T' of the service box.
"I don't know what my legacy will be but I always fought until the last point. Maybe it will be that."
Nishikori and Wawrinka will meet in the third round on Thursday after Nishikori took just over two hours to win 7-5, 7-5 against Bolivian qualifier Hugo Dellien and Wawrinka defeated Argentina's Guido Pella 6-3, 6-4.
- Osaka in control -
Juan Martin del Potro lost 6-3, 2-6, 7-5 to Serbia's Laslo Djere in his first match since February as the Argentine continues to work his way back from a knee injury.
Nishikori's compatriot and world number one Naomi Osaka is through to the quarter-finals of the women's tournament for the first time after she eased past Belarusian Aliaksandra Sasnovich 6-2, 6-3.
"I feel fine, so that's great," Osaka said.
"I'm at a really good place right now. I feel like I'm having fun playing tennis again which is always a good thing for me. I always play well if I have that mentality." In the last eight, the two-time major champion will face Switzerland's Belinda Bencic who beat Ukrainian qualifier Kateryna Kozlova 6-0, 6-2.
A potential semi-final foe for Osaka is world number three Simona Halep, who annihilated Slovakian Viktoria Kuzmova 6-0, 6-0 in 44 minutes.