Question about UiAutomator

I am new at Appium that is why I did not understand some aspects during the working process.

Is UiAutomator installed on phone or it comes with AndroidSDK?

Ui Automator framework has three core components all of which comes with Android SDK

This is great resource. However I did not figured out yet how the whole framework works