When I started my investigations into attic insulation, I thought you only needed baffles if the soffit panel below was vented. However, when I studied the International Residential Code (IRC), I found that this was not the case.
Baffles serve two main purposes. They protect soffit vents from being blocked by insulation, and they channel air up through the attic. Without a baffle-per-rafter setup, this second function is not performed, and the first can readily be compromised.
If air-permeable insulation is installed in vented attics, then baffles are required. They must be installed continuously, i.e., in every rafter, according to code. The reason is to prevent the incoming air from moving into the insulation as opposed to being funneled above the insulation via the baffles.
Purpose of Baffles
As mentioned, baffles serve two functions for attic insulation. This first, preventing soffit vents from being blocked, is the one that most people focus on, which is what leads some people to assume that if there is no soffit vent below that rafter space, you don’t need a baffle.

At first glance, you might think that this reasoning also applies to the second purpose, which is to funnel air up from the soffit vents to the upper vents, creating proper airflow through the attic.
If air is only coming through vented soffit panels, then surely the non-vented ones don’t require baffles.
However, if you look at the way a typical roof is constructed, you can see why this is not advisable. The eaves are a continuous space, and the soffit makes up the “floor” of that space.
The rafters extending past the top plate to create the eaves offer some separation but do not create perfect “walls” between adjacent spaces.
This means that insulation, particularly loose-fill insulation, that falls into the eaves at a non-vented soffit has the potential to migrate to cover a vented soffit panel.
Note: Batt insulation still requires baffles
It also means that air coming in through the soffit vent can move sideways instead of following the grade of the roof.
Insulation slows or stops the passage of air, so this is not going to promote proper airflow.
Why Airflow Is Important
If an attic space is not finished, it must be ventilated. This is to protect it against heat and humidity that may build up over time.
Since heat rises, it often gets trapped in attic spaces. Ventilated attics are also in contact with cooler air outside. When the hot and cold air come into contact with each other, the hot air cools, releasing whatever moisture it is carrying. The result is condensation.
A hot and humid environment is not good for wooden beams, metal fasteners, and insulation. All can degrade over time. Rotting wood and rusting metal compromise the structural integrity of the home, and wet insulation cannot stop thermal transfer effectively.
In addition, there is a very real risk of mold, which can further damage these materials and which poses a risk to the health of the people and animals living in the house.
Proper airflow means that the hot air and the moisture it carries are pulled out of the house and are replaced as opposed to mixed with cooler air from the outside. It also prevents the stagnation of air, which is not good for air quality.

Continuous Baffle Installation Required
Baffles are required by code, and if you look at the regulation stating this, it speaks about situations where soffit venting is not continuous.
It says in Section N1102.2.3 that in these cases, baffles must be installed continuously, meaning one in every rafter.
The reason is even provided in the IRC. This reason is to prevent the air from bypassing the baffle. In other words, it prevents the air from moving sideways and getting lost in the insulation of adjacent rafters.
Sources
https://homeguides.sfgate.com/important-using-baffles-attic-insulation-78043.html
https://attic-air.com/2019/11/13/baffles-rafter-vents/