When you're sailing on a beat or run, the two main strategic factors are usually changes in the wind direction and changes in the wind velocity. Obviously, you want to sail toward the next windshift and sail toward better pressure. But sometimes you can't do both, so which is more important?
In light air, sailing in better wind velocity is relatively more valuable. That's because a small increase in wind pressure will often mean a large increase in boatspeed. When you are sailing in 4 knots of wind, for example, a puff that brings two more knots is huge. In addition, this puff will allow you to sail higher upwind (like a lift) and lower downwind (like a header).
In heavy air, a two-knot puff may not help you go any faster at all. When it's already windy, an increase in pressure is not so valuable. That's why it's usually better to sail for shifts, especially upwind.
A very general rule of thumb is to go for puffs in light air and shifts in heavy air. This is especially true when you are sailing downwind.