A classifier doesn't output "positive" or "negative" — it outputs a score. The two humps in the middle of the scene are the score distributions of the true negative class (blue, back row) and the true positive class (green, front row). Turning that score into a decision means picking a threshold: everything scoring above it is called positive, everything below is called negative. The vertical panel slicing through the bars is that threshold.
On a heavily imbalanced dataset, a model can post a near-perfect ROC curve while its precision-recall curve looks mediocre — because ROC's false-positive rate is diluted by a huge negative class, while precision-recall exposes exactly how many of your "positive" alerts are actually wrong.
Two overlapping score distributions — true negatives behind, true positives in front — get sliced live by a moving decision threshold, while a ROC curve and a precision-recall curve trace out on side boards as the threshold sweeps from strict to lenient.
Every classification threshold trades recall against false alarms. The ROC curve's shape depends only on how separated the two classes are; the precision-recall curve additionally depends heavily on how rare the positive class is — which is exactly why the two curves can disagree.
Drag the threshold to reclassify every bar instantly and watch both curve markers move. Lower class separability to simulate a weaker model, or drop the positive class share to simulate a rare-event problem, and see how the ROC curve barely reacts while the PR curve sags.
A dashed diagonal marks a random classifier's ROC curve (AUC = 0.5); on the PR board, the dashed horizontal line marks a random classifier's precision — which equals the positive class's prevalence, not 0.5.