When you get an advantage and the opponent does a counterplay then you should try to prevent it and keep the advantage.
Looking at this position black tries to get rid of the the knight on d4 by letting the queen on d1 taking the knight on g4. If 8.Qxg4 then 8...Nxd4 is coming and white will not have the center anymore. As now white can prevent by 9.Nxc6 Nxe3 10. Nxd8 Nxd1 11. Rxd1 Rxd8
Now we come to this position while the Bishop on c8 is unable to move while whites minor pieces are well developed. White next move will be 12. O-O with still having a edge.
Black to move
In this position, Petrosian has doubled pawns on the kingside but is not a big problem because those pawns are attacking Spasskys king. The main area where we have to focus is on the quuenside, thats where most action happens. Petrosian is trying to attack on the kingside, but the action is on the queeside. So he decides that he should close up the queenside by doing 17...c4 trying to close up the queenside 18.Be2 a6 making sure that Spassky has no more attack on the queenside. 19. Kh1 Rdg8 20. Rg1 Rg4 21. Qd2 Rhg8 22. a5 b5 White cannot go any attack any further, and he evntually resigned to blacks attack.