Wordy answer, mostly light on Math:
The key word here (and the article uses this word) is "long period comets".
First there's Jupiter impacts, but that's a relatively low percentage, cause even large Jupiter is quite small compared to it's orbit. Even if you extend it out to it's Roche limit where a comet could break apart, it's still a very small target in the grand scheme of things.
But any comet that passes near Jupiter (but doesn't hit it, get captured by it or broken apart in it's Roche limit) gets it's orbit changed somewhat by gravity assist. Jupiter's high mass and relatively high orbital velocity make it the gravity assist king of the solar-system.
The closer the pass to Jupiter, the bigger the change. Gravity assists, change both direction and velocity. They can't change only one. It's safe to assume that half of those gravity assists add velocity to the comet and half reduce velocity. Very loosely speaking, the direction of the comet affects it's Perihelion and it's velocity and any change in it's velocity affect's it's semi-major axis (explained a bit below).
The comet's orbital velocity is obviously dependent on how close the comet is to the sun. (Kepler's law about equal areas over equal times), but any orbiting object also has an average velocity, which is closely tied to the semi-major axis and orbital period, and it's this average velocity and the velocity at Aphelion (it's slowest velocity) that matters for this discussion.
The orbital period of any object orbiting the sun is directly proportional to the 3/2 power of the semi-major axis. The average velocity is very closely correlated to the square root of the distance between the semi-major axis and the Sun.
When you get comets with orbital periods of hundreds or thousands of years, their average orbital velocity, is relatively slow for a celestial object. Pluto's average orbital velocity is about 4.67 km/s and it's minimum velocity at Aphelion is 3.71 km/s. Source.
For longer orbital periods the orbital velocity drops, roughly by the square root of the relative distance, so a comet with an orbital period of 1,000 years (about 4 times Pluto's), would have an orbital velocity about 1/2 as much and a velocity at Aphelion of maybe 1.8 km/s or a bit less.
Escape Velocity for the comet requires just a 41.4% increase on Aphelion orbital velocity, so, with our 1.8 km/s orbital velocity long period comet at Aphelion, if Jupiter gives that comet a push of just about .75 km/s, that would be enough to push that comet out of orbit, where it escapes the solar system.
So, while it might seem logical that Jupiter could send a comet equally towards earth as away from Earth, the relatively small push that a long period comet needs to escape the solar system, makes that a far more likely scenario than a nearly perfect 100 foot put into the Earth's orbit. The odds of a long period comet being thrown out of the solar system by Jupiter is relatively high, especially with multiple passes, where, hitting Earth is like hitting a 100 foot put blindfolded. Earth is a small target. Out of the solar-system is a large target.
For shorter period comets where the added velocity needed to escape the solar system is greater, this grows proportionately less true, but for long period comets which only need a small push to get thrown out of the solar-system, statistically, Jupiter tosses a lot more of those out than it sends towards earth.
The trick is to be very specific about what we're talking about. If Jupiter was, for example, to migrate through the asteroid belt, or migrate outwards through the Kuiper belt, then it's size would send a lot of stuff in towards the inner solar-system. It's not in and of itself, always going to protect Earth and reduce Earth-impacts. It depends on where it is and what the orbits of the comets are, but specifically for long period comets, Jupiter is a-lot more likely to send them out of the solar-system than towards Earth. Not all, just statistically more likely.
It's worth noting that there's a lot we don't know about the oort cloud and how many comets/icy objects are in it. We don't know what percentage of long period comets are jupiter-crossers vs objects with more distant perihelions. When a star or large rogue planet passes through Earth's Oort cloud, it can send some of the icy objects out there in towards the Earth. (Planet 9 - if it exists, probably not so much, as that theoretical planet has probably already mostly cleared out it's orbit), so it's not a key player in sending stuff to the inner solar-systems, but a massive passing object that pass through the oort cloud can do that, at least, that's been theorized, though such events are quite uncommon because space is mostly empty. When those rare events happens, then there's probably an increase in long period comets and when that happens, Jupiter, for the reasons described above, is pretty good at getting rid of them over time.
Scholz's star is thought to have passed within 0.8 light years of our sun some 70,000 years ago and such a pass might be close enough to send a lot of Oort cloud objects in towards the inner solar system (though 0.8 light years it's still a bit far, as the oort cloud is probably quite empty that far out. For a really good number of new long-period inner solar-system comets you'd probably want a 0.1 lightyear pass, or closer . . . . but massive objects passing that close are extremely rare, and . . . I digress).
But Scholz's star might have turned a number of Oort cloud objects into long-period comets that pass through the inner solar-system. (We won't know for a long time, as it'll be perhaps a million years for those new comets to reach us), But assuming Scholz did that, any oort cloud objects entering the inner solar-system from that event would be extremely long period objects and Jupiter would be pretty good at (over time, it wouldn't happen quickly), but over multiple long period orbits which probably takes millions of years, Jupiter would be pretty good at removing most of those from the inner solar-system, but just by chance, it would probably send a few in Earth's direction too. If there was no Jupiter, it would take a lot longer for those long period comets to get cleared out, so in that sense, it really does protect the Earth from Long period comets. There would be a lot more of them if not for Jupiter (and to a lesser extent, Saturn) and more comets would mean more Earth impacts.