The natural and impartial law of karma
does not seek to consciously reward or punish us,
while the positive and negative experience of karma
can be purposely magnified or mitigated by us.
Yes, a group of individuals can create and experience collective karma (共业). However, there is each individual’s personal and differentiated karma (别业) at play too. Take for instance, a crew on a boat, who suffer from its capsize. This experience can be a mix of collective and individual karma, which is often the case. As another example, when, say, a platoon of soldiers kill many innocents in a village, they would have created similar and thus collective karma through their group efforts. Due to this collective karma, they might experience similar negative karmic results later… such as having an equivalently sudden and violent death in a natural disaster. This would be the functioning of their collective karma. We have to note, however, that this in no way implies they will have lower rebirths, as the destination of rebirth would depend on the quality of the last thought of each. Thus, we should never assume that all who have ‘accidental’ deaths will always fare for the worse.
Yet, at the same time, it is impossible for every individual in the platoon to have generated the same intensity of hatred, to have killed the exact same number of people, inflicting the same amount of intentional harm. In this sense, each created personal karma that differs from one another’s. Hence, there is a mix of collective and differentiated karma created. You can think of the collective karma being the common denominator, while there is differentiated karma due to the distinct factors above. Using a simple example, a basket is collectively filled with somewhat similarly citrus fruits, but upon closer look, there can be different fruits, such as oranges and lemons. Using a global example, we humans, and all other sentient beings on planet earth are experiencing the collective karmic effects of the climate crisis. However, not every single being experiences it in the same way due to differentiated karma. One might experience it very adversely while another less so.
It is actually extremely difficult to determine if those who perished in a disaster definitely suffered due to collective karma, differentiated karma or a mix – as all three of below possibilities are possible –  They might have collectively created similar karma through one (or more) incident(s) together to experience.  They might have individually created similar karma through one (or more) incident(s) separately to experience it.  They might have created a mix of  and . The Buddha taught that the exact intricate mechanics of karma are unfathomable to all who are not fully enlightened, who are non-Buddhas, due to our short-sightedness, thus lacking detailed perception of the web of many causes and conditions. As such, other than generally understanding the above, there is no need to speculate on the karmic reasons for why one or many experience suffering. We are victims of negative karma after all, suffering on the same boat adrift the sea of Samsara. What crucial is to do what we can to aid the suffering. It is what we hope others would do for us when we suffer too.
There can be different karma
among those with collective karma,
just as there can be collective karma
among those with different karma.