Assuming password-less authentication, if an attacker is able to gain access to the public key on a host server, they can set up a different machine between the client and the server and place the key there.
When clients connect via SSH, they'll be presented with the same fingerprint as the original machine and their commands could then be intercepted by the attacker.
How does SSH avoid this?