It's pure mathematics. You can see in the image that angle of attack without gust is 4 degrees for the wing and 2 for the tail. When the gust hits angle of attack becomes 8 for the wing (100% increase) and 6 for the tail(200% increase). So tail will have twice as much lift and it will add to stabilizing effect.
You can imagine that airplane is designed so that for a level flight wing needs 4 degrees of angle of attack but tail requires only 2 degrees. So tail is more effective in producing lift as the wing. So as the gust hits it has more effect on the tail and the tail will not allow for airplane nose to pitch up.