Sectorsblue
If there were such a threat (such the US government ordering US companies to spy on Canadian users via secret backdoors, with the demand implemented in court), then iOS users would possibly not know.
Programming languages are readable by humans but not machines.
A compiler makes them readable by machines (1s and 0s).
Apple writes code, compiles it, and no one reads the code. So if iOS were to put in a "Snoop on Canadians" backdoor, it would be in 0s and 1s that users can't read.
Graphene OS is open source. The programming code is listed. The compile code is there, but you can also compile it yourself.
So how would someone know if the compiled code and written code for Graphene were the same? A hash calculator takes a fingerprint of the code, letting people compare if the files have been tampered with.
If Graphene developers publish code, and someone compiles it, it should match the hash value of the binary machine code that is released.
That's why people trust open source code, because corrupt or heroic governments can't force software developers to alter their code when it's open, they can do this with iOS. This doesn't mean they've done that. We don't know.
Closed source code is Always a guess. Hopefully, this code does what they say and doesn't do anything bad.
It doesn't mean all open source code is secure. Sometimes open source code is so big (lots and lots of code) that someone can slip in some malicious code. It's rare but has happened.
If any people who have expertise in computer science want to correct any mistakes in this explanation, please correct them!