LIVE UPDATE: Pakistan v SA Day 2
The South African skipper was unbeaten on 107 for his 27th Test century - his fourth against Pakistan - as the Proteas reached 198-4 at lunch, having a lead of 99 over their rivals' first innings total of 99.
With Smith was AB de Villiers on 26 as the two added 64 runs for the unbroken fifth wicket stand after South Africa resumed at 128-3.
Smith, overnight 67, anchored the innings and reached his century with a straight drive off Saeed Ajmal for only his sixth boundary. It took Smith 204 balls to reach the milestone.
South Africa seek a series-levelling win after losing the first Test by wickets in Abu Dhabi last week.
Paceman Mohammad Irfan gave Pakistan the early breakthrough in the seventh over of the day when he bowled nightwatchman for a sharp incoming delivery as the batsman offered no shot. Steyn made seven.
Irfan could have removed de Villiers first ball, but wicket-keeper Adnan Akmal failed to grab a low edge to his right.
That lapse cost Pakistan dearly as de Villiers hit three boundaries and looked solid to supplement Smith as South Africa looked set for a big lead.
With the two reviews against umpires' decisions wasted on Wednesday, Pakistan were searching for ways to get more wickets as spinners Ajmal and Zulfiqar Babar bowled in tandem on a pitch expected to help the slow bowlers.
Ajmal was the pick of the bowlers with 2-68.