To run on a device you need a provisioning certificate linked to the app ID you're developing. This does not mean you HAVE to publish the app to the app store, you can publish Ad Hoc builds and use the app in closed environments, but is limited to 100 devices. Additionally, you can enroll as a developer to the enterprise program and not use the app store at all, but release to an enterprise with no device limits.
Ad Hoc Distribution Authorizes a Limited Set of Devices to Run Your App
iOS developers enrolled in the Standard Program can also
distribute an app outside of the App Store on up to 100 different
devices for testing purposes only. To use ad hoc distribution, create
an archive of your app, or have a teammate send you an iOS App Store
Package (.ipa) of the archived app.
You distribute your app by providing the .ipa file for users to
install on their devices. Because you select a valid ad hoc
provisioning profile to archive the app, users don’t need to install
the profile on their device, only the .ipa file. Users can use iTunes
to install the app on their devices. If users want to use Xcode to
install the app on their device, share the archive as an .xcarchive
file package.
In-House Distribution Allows Companies to Distribute Apps Internally
iOS developers enrolled in the Enterprise Program can distribute
in-house without identifying individual devices or using the App
Store. To distribute your app in-house, create an archive of your app,
or have a teammate send you an archived app. Distribute your internal
app using your company’s authorized software distribution mechanism.
Because the app file can be installed on any iOS device, make sure you
protect the distribution of this file. Members of your company can use
iTunes, iPhone Configuration Utility, or Xcode to install the app on
their devices.