How does automatic height work?

First of all I have no idea that why App Inventor uses different constant values from android.The constant values defined/used in android are as follows:
Fill Parent/Match Parent : -1
Wrap Content : -2
Now the constant values used in AI are as follows:
Match Parent/Fill Parent : -2
Wrap Content : -1

In answer to your question:
Fill Parent: it will take all available space
Wrap Content: it will take only required space

In android documentation they are defined as follows:
Fill Parent/Match Parent: Special value for the height or width requested by a View. MATCH_PARENT/FILL_PARENT means that the view wants to be as big as its parent, minus the parent’s padding, if any

Wrap Content: Special value for the height or width requested by a View. WRAP_CONTENT means that the view wants to be just large enough to fit its own internal content, taking its own padding into account.