If your sketch is not performing I2C transfers, there doesn't need to be anything connected.
If your sketch is performing I2C operations, you will have at least one other device connected. One will be the master for an transfer, one will be the slave. The master drives the clock for data going out and in.
If you are not using I2C, the pin is commanded like an other IO pin for reads and writes or PWM or whatever.
Like any other IO pin, the pin should not be left floating, as it can fluctuate. It should be pulled High or Low to a valid level to reduce energy use, especially important battery operation. With Atmega328P & similar, internal pullups can be used for that. I don't know what ESP32 has. Fluctuating pins lead to internals switching, which leads to higher current draw.