How are available product quantities determined?

Are our listings updated automatically when a shirt size or color is in or out of stock? What happens if a customer orders a specific size and color and the supplier doesn’t have it in stock?