The ability to install apps from sources that aren't the official app store and the ability to develop apps for free without paying a $100/year subscription?
Both have the same answer - Jailbreak. Which is easy to do if you are technically inclined enough to want to program or to be able to protect yourself from malicious sideloaded programs.
Once jailbroken, you can deploy anything you like without paying the $100 fee to deploy to your device. It also opens up the ability to easily hack any third party application with simple code additions.
Meanwhile non-technical users get a fairly secure system that they cannot screw up too easily.
And on a side note, you don't even need to jailbreak just to install apps from sources not from the app store. Anyone can install ad-hoc builds, anyone with an enterprise license can provide installable apps to anyone (though technically they are supposed to be employees).
Plus an open source kernel, so you can verify that all your activity isn't being routed directly to Apple for the NSA
iOS is as open source in that regard, and there've also been quite a lot of people analyzing network traffic outbound from it.
It's absurd to clam that (for instance) the Android that ships with a Samsung or Motorola phone is something you can see all the source code for... that simply is not true.