It doesn't. Your hypothetical terrorist group can't recruit with equal ease from any demographic group that strikes their fancy. So if we screen everyone equally, all[1] of the terrorists will be young single men.
If we start screening young, single, Arab men so heavily that it's more economical for a terrorist group to recruit Laotian grandmothers, that's exactly what we want. It will dramatically reduce the incidence of attacks, because it's extremely difficult to convince Laotian grandmothers to make them.
The optimal way to allocate screening resources is to produce the result that everyone is equally likely to be a terrorist. But you can't begin by assuming it; it's the goal you want to reach. If there's a demographic group with an elevated risk of offending, we want to dedicate screening to it until it has only the baseline risk. Even if that raises the baseline risk, it's a win for us.
With all that in mind, screening a particular group at a 0% rate won't get you there. But screening 80-year-olds at 0.001% of the rate you screen men 15-25, or less, is probably fine.
[1] most