ELI5: What kind of security mechanisms do software companies use to ensure that the source code of their products will be practically impossible to discover?
Exemple: How does Apple guarantee that the iOS source code will not be discovered by an adversary?
Is there any type of different encryption for this case?
For most of the code, I don't think anything special is used.
Compiling the code already obfuscates it enough. Most function, type and variable names are removed, the compiler does some optimizations and what you end up with is already pretty indecipherable code soup.
There are obfuscators that make the resulting binaries even harder to read/decompile, but further obfuscation also makes your code run slower.