South Africa coach Ottis Gibson was asked in the lead-up to the series if the Indian pace attack had enough in it to make them reconsider the usual policy of batting first in Cape Town. This was, after all, not the usual Cape Town pitch; it had more grass than usual on it. Gibson said it would depend on the overheads on the morning of the Test. The morning was bright with no clouds, and South Africa thought about putting India in, but went ahead and took the challenge of batting the first session out.

Three overs in, South Africa were in crisis. Dean Elgar nicked behind while Aiden Markram was pinned lbw. The ball did a lot, and Hashim Amla would soon perish to make it 12 for 3. Bhuvneshwar Kumar took three wickets in each of his first three overs. Batting seemed treacherous. South Africa were pretty close to their gamble of a spicy pitch backfiring on them.

AB de Villiers, though, batted as if on a different plane. He was helped by Mohammed Shami bowling the first ball to him on his pads. The score didn't matter, the situation didn't matter; the ball was there to be hit, and he hit it. Soon he hit Bhuvneshwar Kumar for four boundaries in one over. In crisis he scored 65 off 84 balls, benefitting from some loose bowling along the way, to take South Africa to a total they could win the Test with.

In Centurion, South Africa didn't get the pitch they wanted. It was slow, it didn't have much bounce, and it turned on day one. Morne Morkel said it felt "100%" like bowling India. South Africa won the toss again - a big advantage this time - but let India back in by not scoring over 400. There was some ordinary running, some loose shots, that let India off the hook. They took a lead of 28 in the first innings, but the third innings was now important. This pitch seemed to now favour India's bowlers whose default mode of operation is to attack the stumps. Two early wickets fell to balls that stayed low and were at the stumps.

South Africa were now 31 for 2 effectively, and it was anybody's game. It was de Villiers' game. Once again he scored 80 at the rate of two runs per three balls to pull South Africa out of trouble. These were two crucial innings in the context of the series even though none of these got him the Man-of-the-Match award. They were played at strike-rates you would be proud of in crisis in ODIs. These were what you would call counterattacks, but to de Villiers these are normal innings.

"Not at all," de Villiers said when asked if he consciously made an attempt to hit South Africa's way out of trouble. "I watch the ball and I just play. I have always said that I don't feel there's a big difference between the three formats. It is just a mindset applying yourself to the wicket and conditions, and that's always been the way that I have played. So no definitely it's not something that I force."

That is how de Villiers bats. He sees the ball early, gets into attacking positions, and defends or leaves only if he must. In an interview to ESPNcricinfo in 2015, he said: "My mindset in all three formats, in any situation, is exactly the same. I just want to get myself in, get myself a nice foundation to hopefully attack and dominate the bowlers. After a period what I call - let's say a period when you have got to earn the right to dominate the bowling. In some innings it takes one ball, sometimes it takes 10 overs, sometimes five overs…"

It hasn't all been smooth of late for de Villiers, with injuries keeping him out of Test cricket. It must feel great to come back and immediately make such a big impact on a grudge series. "Test cricket is the ultimate challenge," de Villiers said. "It was very enjoyable to be a part of a really important and good series win. I think it was a great team effort from everyone, from the fielding to the bowlers with big pressure moments with the bat in hand, just an all-round really good team performance. I am obviously enjoying my cricket and loving it out there with the boys. And it has been a great couple of Test matches."

These might not have been big hundreds, but these have been match-turning, and consequently series-turning, innings. And de Villiers has never felt better about his game. "I feel like I am in the best form of my life right now," de Villiers said. "I am never guaranteed results, never guaranteed five hundreds in a row, I could get five ducks in a row but I am happy where I am at. And I am playing well, and I am doing my preparation well, and I am meeting the ball well. It's just up to the day to take care of itself. I feel at the best phase of my life right now."

Physically, too, de Villiers said he felt he was in a good space. "It feels like my debut back in 2004 when I started as an opening batsman then a keeper at no.7 and back to opening, and up and down," de Villiers said of his body. "It's funny with my comeback now similar to back in the day. But it has been very enjoyable. I feel very fresh, and I have said it on numerous occasions in the last few months that I just feel like just getting out there and playing, and that's what a good break does to you.

"I am feeling in a good space, and the energy is good, and my body is feeling right at the moment. I do have niggles but that is part of Test cricket. You never get up feeling a 100%. The back is still there, the ankles and knees, everything is hurting at times but to be playing the ultimate form of the game again has been a great challenge."

De Villiers is not done yet with India. He will laugh about the last series in India, where some of the best batsmen in the world lost confidence playing on tracks that Faf du Plessis said bordered on the "extreme", but they are gunning for 3-0.

"I can't remember what happened," de Villiers joked. "What happened in 2015? Oh we won the ODI series, yeah. It would be great, India have really impressed me and surprised us in terms of the bowling department so they have shown lot more skill and definitely there is lot more pace than we expected. So we know we are going to have to be watchful in that last Test. They will come out fighting and wanting to finish well in the Test series, and wanting to take that confidence into the ODIs, but obviously we would love to beat them 3-0. But you are never guaranteed of a result. We know we are going to have to dig deep again and make sure that like in the last two Tests we adapt to the conditions and put in our best type of cricket in the conditions."

Sidharth Monga is an assistant editor at ESPNcricinfo