In more detail
The formula is (end / start)^(1/years) − 1. It answers "what steady yearly rate would have produced this result?", which makes investments held for different lengths of time comparable. It uses only the first and last values, so it smooths out ups and downs and hides volatility, and it ignores money added or withdrawn along the way; for irregular cash flows use the IRR instead.
Why it matters
The simple average of yearly returns overstates what you actually earned whenever returns vary. CAGR is the figure that, compounded, reproduces your real ending balance, so it is the honest one to compare against a benchmark or an inflation rate.
Example
An investment that grows from $10,000 to $16,000 in 5 years has a CAGR of (1.6)^(1/5) − 1 = 9.86%. Now take a year of +50% followed by a year of −50%: the average return is 0%, but $10,000 becomes $15,000 and then $7,500, a CAGR of −13.40% a year.
Common confusion
ROI is the total gain over the whole period with no time dimension; CAGR spreads it into an annual rate.