MS Project makes calculation based on the following formula:
DURATION = WORK / ASSIGNMENT UNITS
So, if a resource can complete a task by working for 8hrs. full time, i.e. 100% on a task its duration is 8 hrs. If the resource works only half day, i.e . 50%, the task duration becomes 16 hrs.