This has some similarities to another current thread: My touchscreen does not work with ESP32 DEVKIT V2 and ili9341
Usually the touch screen controller and the tft display controller are on the same SPI bus. That means, for example, that pins T_clk (touch screen clock) and Sck (TFT display clock) are actually connected to the same pin on the ESP32.
On an SPI bus, pins SCK, MOSI and MISO are shared. Note these pins often have slightly different names depending on the peripheral. Only the chip select pin (usually CS or something similar) is unique and this is used to determine which peripheral device, in this case the touch screen controller or the TFT screen controller, is currently active on the bus.