Question about IDF version of ESP platform version 3.4.0

This is correct for projects using the espidf framework directly (framework = espidf, example).

Arduino-ESP32 uses a precompiled ESP-IDF base and does not build ESP-IDF from source. PlatformIO is currently using Arduino-ESP32 version 1.0.6, which is not the latest 2.0 version. Supporting that is an open issue (Support for the latest Arduino v2.0 · Issue #619 · platformio/platform-espressif32 · GitHub) (with workarounds available).

As such, when using PlatformIO with framework = arduino and platform = espressif32 projects, you will have Arduino-ESP32 1.0.6, which based on a precompiled ESP-IDF v3.3 version.