The THESAN project: properties of the intergalactic medium and its connection to Reionization-era galaxies