Monkey talk library is using aspect-oriented programming (AOP) and aspectJ combination to get current task thats why they are adding
<uses-permission android:name="android.permission.GET_TASKS" />
permission. Now using using this permission they can access application current Activity and its view. So they are parsing current view each time when its changed and adding new listener for these views.
In Android, MonkeyTalk code is invoked by AspectJ aspects - bits of code which are "weaved" into the app and get invoked when cerain methods are called. In iOS, MonkeyTalk is initialized statically, forced by using the "-all_load" linker flag.
That's why one must have access to the application source. But once one has been compiled the app, one no longer need the source, and can handoff the APK to QA.