Check out example codes for "vs code tab space settings". It will help you in understanding the concepts better.

Code Example 1

// The number of spaces a tab is equal to. This setting is overridden
// based on the file contents when `editor.detectIndentation` is true.
"editor.tabSize": 4,

// Insert spaces when pressing Tab. This setting is overriden
// based on the file contents when `editor.detectIndentation` is true.
"editor.insertSpaces": true,

// When opening a file, `editor.tabSize` and `editor.insertSpaces`
// will be detected based on the file contents. Set to false to keep
// the values you've explicitly set, above.
"editor.detectIndentation": false

Code Example 2

"editor.insertSpaces": true,
    "editor.tabSize": 2,

Learn ReactJs, React Native from akashmittal.com