Because the TARDIS is telepathic
The Heart of the TARDIS is not just a core of energy, it is:
The Heart of the TARDIS (also known as space-time element) was a core element of TARDIS technology. It was the basic life and mind, (PROSE: Falls the Shadow) the "soul" of the ship.
In the transcript for Boom Town, The Doctor notes that TARDIS used its temporal energy to give the Slitheen a second chance because it sensed what to do when the it stared into the heart:
ROSE: What happened to Margaret?
JACK: Must've got burnt up. Carried out her own death sentence.
DOCTOR: No, I don't think she's dead.
ROSE: Then where'd she go?
DOCTOR: She looked into the heart of the Tardis. Even I don't know how strong that is. And the ship's telepathic, like I told you, Rose. Gets inside your head. Translates alien languages. Maybe the raw energy can translate all sorts of thoughts.
(The Doctor finds a large egg with dreadlocks on the top inside the bodysuit.)
DOCTOR: Here she is.
ROSE: She's an egg?
DOCTOR: Regressed to her childhood.
JACK: She's an egg?
DOCTOR: She can start again. Live her life from scratch. If we take her home, give her to a different family, tell them to bring her up properly, she might be all right!
JACK: Or she might be worse.
DOCTOR: That's her choice.
ROSE: She's an egg.
DOCTOR: She's an egg.
In Parting of Ways:
DOCTOR: What've you done?
ROSE: I looked into the Tardis, and the Tardis looked into me.
DOCTOR: You looked into the Time Vortex. Rose, no one's meant to see that.
So the TARDIS is responding to the viewer's needs and desires, and probably the TARDIS's own desires.
Out-of-universe, the TARDIS is itself a bit of Swiss Army Superpower for the Doctor, with the core ability being "manipulate time and/or space".