I can plug in an iOS device and tell Xcode to run my app on that device or stop it. I can have the app paused at any time and use the debugger to debug the running app. How is this all possible? There must be some kind of a background process on iOS that acts as a liaison between Xcode and the debugger and iOS.
There are a number of diagnostic services that run in background on iOS devices.
I don't think Apple have completely documented the way that Xcode communicates and controls processes on iOS devices, but after a 2014 presentation at a hacker conference by security researcher Jonathan Zdziarski, Apple documented a few of the background processes that allow access to data on iOS devices.
house_arrest is used by iTunes to transfer documents to and from an iOS device for apps that support this functionality. This is also used by Xcode to assist in the transfer of test data to a device while an app is in development.