They don’t all need a lot of security - and not the same amount at all times.
That’s why Beatrice and Eugenie had their security needs down graded and also why Harry would probably have been in a similar position to the Yorks as time went on even if he hadn’t left the country.
The security threat is both to the individual, to innocent bystanders who might get caught up in any attack. and to the country in terms of how an attack on certain individuals can create feelings of fear in the public and heightened feelings of being under attack - that has knock on effects on the economy, on how secure businesses feel, how international tourists feel etc.
Sometimes it’s not terrorism, sometimes it’s violent protesters, or protesters trying to do something non violent but significant to gain attention etc. Sometimes it’s just butter attracted to the celebrity of someone they see.
So Anne only gets the police security when she’s on official visits. That’s because there’s a need to manage any crowds, manage anyone who might want to use the media attention for their own cause, or someone who might do something to cause a splash in front of the press that would put members of the public in danger as well as Anne.
And you only have to look on Twitter to see the sick people who have made all kinds of awful threats about the Wales children. Security protects George etc but also all the kids he goes to school with, who would be collateral damage if someone tried to do something to him in school.