Apple has admitted to giving the US government information.
So they don't run algorithms over your meta-data, instead they just give your personal info the the government.
I'm aware Google does comply with government requests too, but also attempts to push back and keep the government honest.