Because each node generates its own key pair and when encrypting a message you choose a random route and you use the keys of the nodes of your route to encrypt each layer.
What the person you're replying to is talking about is a Sybil attack. You pick random nodes, yes, but what if the list of nodes to pick randomly from is 99.5% the attacker? This is a real world attack that has been used against Tor, for example.