Default configuration. The release configuration of your firmware/program
does not contain symbolic debug information and is fully optimized.

Debug:

The debug configuration of your firmware/program is compiled with full
symbolic debug information and no optimization. Optimization complicates
debugging, because the relationship between source code and generated
instructions is more complex.

As we mentioned before, PlatformIO builds project in Release configuration
by default. You can build project in Debug configuration using one of
these options:

If you use the same build environment for “Release” and for PIO Unified Debugger,
PlatformIO will rebuild your project each time when you switch between
build configurations. To avoid this issue, please declare 2 separate
project build environments in “platformio.ini” (Project Configuration File) as described below in example.

Otherwise, please add targets=debug to your build environment and
PlatformIO will build project using “Debug” configuration even when you
do not use PIO Unified Debugger.