I would like to know whether the cave sounds in Minecraft also appear in flat worlds.
No, there are no caves either. The sounds only sound when you are underground, where it is dark enough.
The room must be 3x3x3 blocks, the https://minecraft-de.gamepedia.com/....com/Licht must be darker than night and must not have access to the sky.
There's a "mood" percentage that increases when you are in the dark.
The value then increases until it is at 100%. Then a "cave sound" is played and the value is reset to 0% and goes back up to 100%.
You can read more about this in https://minecraft-de.gamepedia.com/...m/Ambiente.