What defines a perfect move?


Good point. I just finished a game where Stockfish 8, 20 ply, rated both sides moves as shown below (I had Black). For the vast majority of moves, Stockfish considered several moves to be essentially as good as the "best" move. So there are often several moves that are as "perfect" as each other. They equally develop, threaten, protect, etc.
The blue moves are not all great moves, they just agree with Stockfish's choice of best move. NONE of the moves are actual blunders except White's move 34, the ? and ?? indicated Stockfish's like another move more than just a little better. Note how often Stockfish lists the difference between White and Black as 0.00! This was a very drawish game until White's move 34. The game itself is annotated here:
https://www.chess.com/forum/view/game-showcase/outside-passed-pawn-wins-great-endgame

Good point. I just finished a game where Stockfish 8, 20 ply, rated both sides moves as shown below (I had Black). For the vast majority of moves, Stockfish considered several moves to be essentially as good as the "best" move. So there are often several moves that are as "perfect" as each other. They equally develop, threaten, protect, etc.
The blue moves are not all great moves, they just agree with Stockfish's choice of best move. NONE of the moves are actual blunders except White's move 34, the ? and ?? indicated Stockfish's like another move more than just a little better. Note how often Stockfish lists the difference between White and Black as 0.00! This was a very drawish game until White's move 34. The game itself is annotated here:
https://www.chess.com/forum/view/game-showcase/outside-passed-pawn-wins-great-endgame

Hindsight usually.
Exactly. In this thread, for instance, I analyze in hindsight how Carlsen could have won his first WCC game against Karjakin:
https://www.chess.com/forum/view/game-analysis/how-carlsen-could-have-won-game-1-of-the-2016-wcc