What is CPM? The cost-per-thousand metric, and what it hides

CPM is the price of a thousand impressions — the base unit of media buying. Here is how it is calculated, how it connects to CPC and CPA, and why a low CPM can still be expensive.