He bowled a relentless length at lively pace and was rewarded with his sixth five-wicket haul in Tests and became the 11th Indian and only the fifth fast bowler to take 200 wickets in Tests.
"Test cricket is not rocket science," he said. "It is important to understand your lengths and the conditions . . . like I always do I was just hitting my lengths."
He said taking 200 Test wickets was something that he had never imagined when he was a youngster. "You just dream that you play for India or play alongside those who you have seen on TV. I come from a village where there are no cricket facilities even now. My father used to send me 30km away to train."
In contrast to the first day, when India made 272 for three, it was a day for the bowlers after the second day was rained off.
With an extra half hour added to make up for the lost overs,18 wickets fell for 268 runs.
Temba Bavuma, who top-scored for South Africa with 52, said the first session on Wednesday would be "super key".
"Today we had the intensity we required. Hopefully there will be a reasonable target that the batters can chase down. But the batters are going to have to knuckle down."
Bavuma admitted that a lack of recent Test action - South Africa have not played since a series in the West Indies in June - had contributed to the team's struggles.
"I don't want to be accused of making excuses for our play but it does have an impact," he said. "If you look at the way we played on the first day we didn't have the intensity that I know we can play at."
Bavuma said there had been significantly increased deviation off the pitch compared to the first day. "The movement was a bit challenging," he said.
South African fast bowlers Lungi Ngidi and Kagiso Rabada bowled the hosts back into the match as India lost seven wickets for 55 runs at the start of the day.
But India's fast bowlers, led by Shami, made outstanding use of the new ball on a pitch which had quickened up and which had numerous indentations, caused by balls hitting a relatively soft and slow pitch on the first day. The indentations made the bounce unpredictable, a frequent phenomenon at Centurion.
Jasprit Bumrah made the first breakthrough for India, having South African captain Dean Elgar caught behind in the first over.
But Bumrah was off the field for most of an extended afternoon session after landing awkwardly on his right ankle in following through in his sixth over.
Bumrah returned to the field shortly before tea but was only able to bowl again towards the end of the innings, claiming the final wicket when Keshav Maharaj was caught at short third man.