E.g. ESP 32 has an internal clock of 240MHz, but can transmit at 2.4GHz (following 802.11 standard). How is this accomplished? Does it really generates a wave at 2.4GHz frequency? Is it not limited by the internal clock? I know it's digital modulation and I'm still learning about RF so any recomended literature would also be appreciated.
Modulation is not typically done at the carrier frequency, but rather at a lower frequency and upconverted. In the era of digital modulation, it's not even uncommon for the key processing to be done in the context if IQ signals centered on a frequency if 0 Hz.
Upconversion does require a local oscillator, but this is a sine wave rather than square, and only drives a small part of the radio circuitry, not the chip in general. Typically today that would be synthesized in relation to a convenient frequency crystal.