On my wife's iPhone, they have groups that allow _certain people_ to contact them with _everything else_ being disabled. I would assume there's similar settings across devices.
I have been using similar settings on a Pixel 3 (Android 12). I'm not sure if it's provided by the OS or Google's dialer app though.
Yes, it’s on iPhone, you can filter by contact type or what you’re doing:
iPhones have a "Silence Unknown Callers" feature now which sends anyone not in contacts straight to voicemail. It's also a bit smarter so if you call someone it will allow them to call back even if they aren't in your contacts list.