The CPI tracks a fixed basket of goods and services, with prices weighted based on typical consumer spending. The change in this basket's total cost over time reflects inflation. Government agencies collect price data and calculate the CPI.