How are over and under stock calculated?

Is there an example?

Here is an example chart:

Go the inventory planner module. View the product and the field safety stock. In your settings, go to inventory settings. 

The overstock and understock value is 3. This means if QuantityOnHand * 3 is more than SafetyStock, then the product is overstocked. If QuantityOnHand * 3 is less than SafetyStock, then it is understocked.