The difference between them and them all is usually just a way of making it clear that the action applies to all of the elements within the collective noun or group, and not just to some (but not all) elements of the group, or the group noun itself.
When my friends came over for a party, I cut them all a piece of cake.
In this sentence, a piece of cake was cut for every member of the collection "my friends" - i.e. each of my friends was given a piece of cake.
If we had chosen "them" instead of "them all":
When my friends came over for a party, I cut them a piece of cake.
We leave ambiguous the possibility that I cut a single piece of cake to be shared by the whole collection (i.e. one piece shared between all of my friends).
When we went to the pond to see the ducks, we gave them all some bread
implies that the author gave bread to each of the ducks at the pond, contrasting with
When we went to the pond to see the ducks, we gave them some bread
where it is possible that the author only gave bread to the collection of ducks as a group, and that some of the ducks in the group may not have been given bread.
So in summary, them all tends to be used where the author wants to make it clear that the action applies to each member of the group, whereas them can also refer to the group as a whole without specifically referring to each member of the group.
Increasingly the use of "them all" is becoming deprecated in favour of "each of them". Consequently, if you're not sure, use this form:
When my friends came over for a party, I cut each of them a piece of cake.