Nine friends report how many minutes they spent on their phones yesterday, sorted: 40, 55, 60, 70, 80, 85, 95, 110, 400. The median is the 5th value, 80. Leave it out and split the rest: the lower half 40, 55, 60, 70 gives Q1=255+60=57.5, and the upper half 85, 95, 110, 400 gives Q3=295+110=102.5. The IQR is 102.5−57.5=45 minutes: the middle friends' times fit inside a 45-minute window.
Now look at the friend who reported 400 minutes. The range is 400−40=360 minutes, mostly because of that one value. Change 400 to 120 and the range drops to 80 minutes, but Q3 is still 295+110=102.5 and the IQR is still 45. The IQR ignores how far the outer quarters stretch, so one extreme value cannot inflate it.
Is 400 an outlier? The upper fence is Q3+1.5×IQR=102.5+67.5=170, and 400>170, so yes. Keep the IQR separate from the range (maximum minus minimum) and from Q2, the median: the IQR is always a width, a difference of two quartiles, never a position. With very few values, say five, each half holds only two numbers, and the IQR loses much of its resistance to outliers.
Think of it like this. The IQR measures the width of the middle of a concert crowd, ignoring the stragglers at the back and the fans pressed against the stage. However far the stragglers wander, the middle of the crowd stays the same width. The comparison fails for a tiny crowd, where there is hardly a middle to measure.
Core idea. IQR throws away the extreme 25% on each end and measures only how wide the central 50% of the data is.