When using configurable products, there are multiple simple products. Each simple product has its own stock. A configurable product does not have stock and is really a virtual product. It's not an actual product but an instance that can be shown in the product list. Customers will always have to select a simple product when purchasing.
You can select which stock should be used in the following module of the CMS of Magento 1:
System > Configuration > Tweakwise > Section Export > Stock combination
You can select which stock should be used in the following module of the CMS of Magento 2:
Stores > Settings > Configuration > Catalog > Tweakwise > Export > Combined product stock calculation mode
These options are available:
- Sum The sum of the stocks of all the simple products (almost always suitable)
- Maximum The simple product with the highest stock will be used
- Minumum The simple product with the lowest stock will be used