The short run average total cost curve has the U shape because of diminishing marginal product. Diminishing marginal product means that there are diminishing returns from the variable input in the short run. Remember that in the short run, at least one input in production is fixed. Diminishing returns implies an increasing marginal cost, and an increasing marginal cost gives the U shape to the short run average total cost curve.
Now in the long run, we allow all factors of production to change, so their is no more diminishing marginal product. What gives the long run average total cost curve its U shape are the concepts of economies of scale, constant returns to scale, and diseconomies of scale.
Economies of scale occur when an equal percentage increase in all factors of production results in a greater percent increase in output --eg. 10% more workers and a 10% bigger factory results in 15% more tacos being made.
Economies of scale can occur because firms are taking advantage of their size and specialization. Being bigger allows for cheaper training, less overhead, need for managers, people working more efficiently together, etc.
Constant returns to scale occur when an equal percentage increase in all factors of production results in the same percent increase in output -- eg. 10% more workers and a 10% bigger factory results in 10% more tacos being made.
Constant returns to scale can occur when every additional unit of input is identical to the last no real gains or losses in efficiency occur.
Diseconomies of scale occur when an equal percentage increase in all factors of production results in a lower percent increase in output -- eg. 10% more workers and a 10% bigger factory results in 5% more tacos being made.
Diseconomies of scale can occur when firms become too big and confusing. While history has shown relatively few examples, there are some companies that tried to make industrial towns. These firms ended up having to finance their own police and fire fighters, take medical care into consideration, and other things the firm wasn't really good at doing. This raised costs tremendously, and the firms suffered from diseconomies of scale.
The graph above shows 3 short run average total cost curves, and their relationship to the long run average total cost curve. You can see that each short run average total cost curve intersects the long run average total cost curve at a specific point. When the fixed input (in the SR) is increased, the SRATC will shift right. If the minimum of the SRATC curve goes down, the firm is experiencing economies of scale, and LRATC slopes down. At some point, the minimum of the SRATC curves will be equal and we have constant returns to scale. After this point, increasing the inputs will result in diseconomies of scale and the LRATC slopes up.