The extension automatically configures IntelliSense in the C/C++ for Visual Studio Code extension. The extension checks the current file in the editor against the build configuration and source tree it belongs to. It then parses the build configuration, collects all the relevant compiler options, and configures IntelliSense for the current file.
You can simultaneously open source files that are shared by different build configurations. This is due to the structure and dependencies of an application source tree and the fact that you can work with multiple applications and build configurations in your workspace, for example nRF Connect SDK source files. In such cases, the extension tries to match the compiler options to the selected active application and build configuration.
If your settings contain C/C++ extension configurations (C_Cpp.defaults.<file-name> files), these might conflict or override the autoconfigured settings. To check which settings are applied, use the C/C++: Log Diagnostics command from the Command Palette.