It doesn't have any logic, it's just prediction based on statistics.
There is so many examples already floating around that it has no logic but I will give you really simple one from my experiments:
I told it to:
> curl somedomain.ext
It replied with curl error that this hostname doesn't exists.
Then I told it to:
> curl https://somedomain.ext
And it replied with some random http response showing that this hostname exists.
There is no logic here.