At $Q$ the ant can choose first to go left to $T$, then right to $W$. Otherwise, at $Q$ it can go right to $R$ and then left to $W$.
$W$ is the corner diagonally opposite to $P$ and is reached by either route after three edges (and no fewer). So after exactly three more edges, the ant must reach the corner opposite $W$, that is, $P$.
This problem is taken from the UKMT Mathematical Challenges.