There's a connected grid across most of continental europe. If Portugal's grid blacked out unexpectedly then Spain's grid could have been made unstable too, which then continue onwards to South of France and Italy.
Just a typical cascade failure because it means everything's now running with lower tolerances.
A cascade failure (of any system) would propagate until it runs into a part of the system that's resilient enough to not fall over.
Several people have said the amount of power transferred between France and Spain is very low compared to the amount of power consumed inside either France or Spain, which seems like as good as reason as any that it didn't affect France. The grid in France was presumably able to absorb the sudden change in power flow without itself breaking.
There aren't as many interconnects between Spain and France proportional to generation as there are between Spain and Portugal.
Also France has a massive Nuclear base load and is usually an electricity exporter so their grid will be a bit more resilient (the spinning mass of massive turbines in Nuclear plants provides inertia to the grid itself) than the Spanish/Portuguese grid that would have had a decent renewable mix.
At the same time, electricity grids will have various measures to prevent instability spreading. Whether that's load shedding (dropping parts of the grid), removing production, or what France likely did, dropping the interconnects. This is usually fully automated.
If there were more connections to France it _maybe_ could have spread further. Nuclear power plants can be twitchy if things go south so if it had spread enough to knock 2-3 french plants offline then that could potentially have toppled France which then as a big exporter could have swept across much of the rest of mainland Europe (and maybe even the UK which might struggle to adapt to the loss from France through its HVDC interconnects if all three were maxed out)
Just a typical cascade failure because it means everything's now running with lower tolerances.