In this video you will understand in detail what is AppCompatActivity with simple real life examples.
Reference Link to the AppCompatActivity: http://developer.android.com/reference/android/support/v7/app/AppCompatActivity.html
So basically MainActivity which is an empty class inherites the function from AppCompatActivity class.
آی-ویدئو