The Russian, who won the French Open on clay last year, brought a 16-match winning streak on the surface into Madrid and was strongly favoured to coast past a player who has been dogged by knee injuries.
But she struggled at times in the first set before finding her range in the second.
It had all been about adjusting to the dirt surface and the particular demands of playing in Madrid, Sharapova said.
"I feel like in the last week I've really had to adjust to the different circumstances and the environment a bit," she said.
"When I got here it was really cold and the ball and the court were really heavy.
"A few days have passed and it's like a whole 'nother tournament.
"For me, it's just been about adjusting when you play indoors for over a week and you get back here and see the sun for the first time. It's a bit of an adjustment.
"The altitude as well. So I think there are a lot of things that come into playing when you're playing here."
The stakes are high for Sharapova in Spain as she could regain the world number one spot from Serena Williams if the results go her way.
Williams won through in straight sets on Sunday and the two could face off in the championship match at the end of the week.
Another former world number one Victoria Azarenka of Belarus had a tough battle but the third-seeded Belarus player came through in two tie-breaks 7-6 (10/8), 7-6 (7/3) against the in-form Russian Anastasia Pavlyuchenkova, who won the Portuguese Open on Saturday.
Azarenka, who opened the Grand Slam season with a repeat victory in the Australian Open, said that it had been the perfect match to return to after being away with a right ankle injury she suffered in late February at the Indian Wells tournament.
"Well, yeah, it was a tough match," said the 23-year-old.
"Honestly, I don't think I could have asked for a better match to start after a break.
"There was everything there. A lot of up and downs and a lot of fighting.
"Obviously she's (her opponent) playing really good now. She won a tournament. It's a great test for me for the first match.
"I'm really happy the way I pulled it off. It's a great platform to start improving and getting the preparation, more and more preparation for the next tournaments as well."
If Azarenka, Sharapova and Williams safely won through to the second round, the same could not be said of some of the other seeds.
Both Caroline Wozniacki of Denmark and China's Li Na crashed out on Sunday and Monday saw the end for Australia's Samnatha Stosur as she lost 7-6 (9/7), 6-2 to home hope Carla Suarez Navarro.
The 2011 US Open champion was competitive in the first set, but, once she lost that on a tie-break, her game unravelled and she was outplayed by the Spaniard, who lost the final of the WTA tournament in Portugal on Saturday to Anastasia Pavlyuchenkova of Russia.
Poland's fourth seed Agnieszka Radwanska also bowed out, beaten comprehensively 6-3, 6-1 in the second round by fast rising 19-year-old Briton Laura Robson.
Robson will play either another former world number one Ana Ivanovic or South African qualifier Chanelle Scheepers in the third round.
Sixth seeded German Angelique Kerber came safely through with a 6-4, 6-2 win over Alize Cornet of France, while former world number one Victoria Azarenka of Belarus, seeded third, was scheduled to play later against Pavlyuchenkova.
In early action in the men's tournament, Japan's 14th seed Kei Nishikori was too good for Jurgen Melzer of Austria winning at a canter 6-3, 6-2.