Long-run average cost is the unit cost of producing a certain output when all inputs, even physical capital, are variable. The behavioral assumption is that the firm will choose that combination of inputs that produce the desired quantity at the lowest possible cost.
A long-run average cost curve is typically downward sloping at relatively low levels of output, and upward or downward sloping at relatively high levels of output. Most commonly, the long-run average cost curve is U-shaped, by definition reflecting economies of scale where negatively sloped and diseconomies of scale where positively sloped.
If the firm is a perfect competitor in all input markets, and thus the per-unit prices of all its inputs are unaffected by how much of the inputs the firm purchases, then it can be shown that at a particular level of output, the firm has economies of scale (i.e., is operating in a downward sloping region of the long-run average cost curve) if and only if it has increasing returns to scale, the latter being exclusively a feature of the production function. Likewise, it has diseconomies of scale (is operating in an upward sloping region of the long-run average cost curve) if and only if it has decreasing returns to scale, and has neither economies nor diseconomies of scale if it has constant returns to scale. With perfect competition in the output market the long-run market equilibrium will involve all firms operating at the minimum point of their long-run average cost curves (i.e., at the borderline between economies and diseconomies of scale).
If, however, the firm is not a perfect competitor in the input markets, then the above conclusions are modified. For example, if there are increasing returns to scale in some range of output levels, but the firm is so big in one or more input markets that increasing its purchases of an input drives up the input's per-unit cost, then the firm could have diseconomies of scale in that range of output levels. Conversely, if the firm is able to get bulk discounts of an input, then it could have economies of scale in some range of output levels even if it has decreasing returns in production in that output range.
In some industries, long-run average cost is always declining (economies of scale exist indefinitely). This means that the largest firm tends to have a cost advantage, and the industry tends naturally to become a monopoly, and hence is called a natural monopoly. Natural monopolies tend to exist in industries with high capital costs in relation to variable costs, such as water supply and electricity supply.