Because it's an regurgitation algorithm which is capable of multiple levels of abstractions.
It understands nothing. It cannot do reasoning.
It's possible it might develop a reasoning "part" if the parameters and training are specified in a certain way, but even then it will be up to chance if it develops a sub-part of it's abstraction mechanism that will actually be able to do pure logic without just guessing smartly what should come next.