About Distant Relays

Why does Tor choose distant relays even when closer ones are available?

For anonymity, I believe.