Hi,
You'll see, after you add the variants (color, size, etc) for the product, you can edit each variant. When you do, you'll get a form similar to the main product form where you can enter information specific to that variant.
If the field is left empty in the variant, then it dynamically uses the value from the main product.
If the field is filled in in the variant, it's that value that is used.
So for the stock, you can leave for example the quantity unlimited in the main product and enter the quantity for each variant.
Or you can enter the stock on the main product only and the stock will be shared among the variants.
Or you can specify the stock in each variant and the total stock in the main product and both will be updated after a purchase while only the variant stock will be taken into account when purchasing a specific variant.
And it's the same for the prices, and basically any other information attached to products.