If you have 40 units that cost $5 and receive 60 more at $6, your weighted average cost is (40 × $5 + 60 × $6) ÷ 100 = $5.60 a unit. It smooths out price changes between shipments, so one expensive order doesn't swing your margins.
Glossary
Weighted average cost
The average cost per unit of your stock, weighted by how many units you bought at each price.