Sorted vs. unsorted iteration through a branchy loop

This loop runs over a large array of random 32-bit integers, and is timed twice: once with data left in random order, once after std::sort(data.begin(), data.end()) is called first (the sort's own time is excluded, only the loop below is timed). The sorted run is measurably faster, often by several times, despite doing the exact same arithmetic and touching the same memory footprint in the same linear order either way. What's the primary cause?

main.cpp
long long sum = 0;
for (size_t i = 0; i < data.size(); ++i) {
    if (data[i] >= threshold) {
        sum += data[i];
    }
}

5 of 47 in Computer Architecture