Look at the .vscode/c_cpp_prroperties.json file, it tells the IntelliSense system all the folders where header files will be searched for. The only folders missing there are the toolchain-builtin files (like e.g., stdint.h, stdio.h, …).
For an ESP32 project, the sources and header files are stored
in the Arduino-ESP32 package, default C:\Users\<user>\.platformio\packages\framework-arduinoespressif32
that includes the cores/esp32 folder, tools\sdk\include and all built-in libraries you use in the project from libraries
the toolchain package, standard C:\Users\<user>\.platformio\packages\toolchain-xtensa32
any libary you specify via lib_deps will be stored at .pio\libdeps\<env>
the project folder’s lib/ libraries
the project folder’s include/ folder
In VSCode, you can Ctrl+Click on a #include <some_header.h> line to see where the file leads to.