How come Agent A who is having 3 work items has the capacity impact of 1?
You've misread this part. Agent A has a used capacity of 3; they have three items worth one capacity each. In this example, they're showing that A is less active than B.
How come Agent B who has 1 active work item has the capacity impact of 4?
Each work item has a capacity value. In this case, B's work item has an assigned value of 4.
Finally, if someone please help me to understand the Least Active model that will be really helpful.
In this text, A is less active than B, because A has 3 points of capacity used, while B has 4 points of capacity used. 3 is less than 4, so A is less active than B.
The difference between Least Active and Most Available is simply how the values are checked. In this case, A and B have the same capacity, so there's no difference. However, if A had the same items, and B had the same items, but A had a capacity of 5 and B had a capacity of 10, then the difference becomes apparent. Under Least Active, A would be selected, because 3 is less than 4, but under Most Available, B would be selected, because A has 2 available capacity (5-3=2), but B has 6 available capacity (10-4=6).