Cache locality refers to the practice of organizing data in memory to minimize cache misses and improve performance by taking advantage of the hierarchical nature of modern memory systems. It exploits both temporal locality, where recently accessed data is likely to be accessed again soon, and spatial locality, where data located close to recently accessed data is likely to be accessed soon.