Stack-allocated memory benefits from superior cache locality because it is contiguous and accessed in a predictable Last-In, First-Out (LIFO) pattern, meaning frequently used data is often near the CPU's L1 cache. Heap-allocated objects, being scattered across memory, are more prone to cache misses, leading to slower access times.