The term average cost has slightly different meanings in economics and accounting. In economics it is simply the total cost of (fungible) products manufactured over a period divided by the number of units produced. I accounting it is a method of allocating costs to (fungible) units of stock: i.e.: an alternative to FIFO, LIFO and replacement cost.
An average cost (in the accounting sense of the phrase) is a weighted average of the cost of all units available over a period, both those remaining from previous periods, and those purchased during a period. More recent purchases are more heavily weighted.
Cumulative/perpetual average costing
When using this method a new cost per unit is calculated whenever new stocks are received:
unit cost = (total value of old stock + total cost of receipts) ÷ (units of old stocks + units of received)
total cost of old stock = old unit cost × units of old stock, bar rounding errors.
When stocks are issued (e.g. sold and shipped out) they are costed at the unit cost recalculated after the last receipt and unit cost × quantity issued is deducted from the total cost of stocks.
Periodic weighted average cost
This calculation is broadly similar, except that the unit cost is calculated only at the end of a period. Issues during that period are issued at that unit cost.
This calculation is simpler, both to calculate (which is not that important as either method is easily automated), and because record keeping is simpler.
The disadvantage is obvious: the numbers are not available until the period end.
The lower weightings given to the cost of earlier receipts means that both methods are forms of moving average.