How does iOS detect the version of an installed app?

It’s the Info.plist, heavily cached. Changing this on a jailbroken device is a common way to prevent App Store updates for an app.