A simple moving average (SMA) adds the last N closes and divides by N. An exponential moving average (EMA) gives more weight to recent prices, so it turns faster. Common lengths are 9, 20, 50, and 200 periods.
Moving averages smooth noise and act as dynamic support and resistance. Their crossovers (golden-cross) are widely watched. They are lagging by design: they tell you what the trend was, not what it will be.
Example: closes of $10, $11, $12, $13, $14 give a 5-period SMA of $12. If the next close is $20, the SMA becomes $14 while a 5-period EMA jumps to about $15.7.
Related: golden-cross, trend, support, vwap