Excellent explanation found on Math Stackexchange.
Basically for finite index sets (finite number of factors), the two constructions are the same.
Only when there is an infinite number of factors, the direct sum is the subgroup of the Cartesian product consisting of all tuples
where there are only finitely many
that are nonzero.