And condition is here: \Magento\Framework\App\EnvironmentFactory::createEnvironment
It does check if file with compiled content is exist for current area: "/var/di/global.ser", "/var/di/frontend.ser" and "/var/di/adminhtml.ser" correspondingly.
The difference is in performance of Object Manager. Constructor dependencies and plugins information is serialized in those files, so Object Manager instantiating objects faster, without using Reflection and calculating chains of dependencies. And doesn't matter if your instance is running in developer or other mode. Object Manager factory is resolved based on availability of those files only. If file for corresponding area is available then "Compiled" factory is used, if file is not available then "Developer" factory is used instead. And "Production" factory is left out and will be removed from the code base.