Technical term for associating a group with the actions of a few

The scientific term for this is "the fallacy of composition":

The fallacy of composition arises when one infers that something is true of the whole from the fact that it is true of some part of the whole.

From The University of Tennessee at Martin:

The Composition Fallacy occurs when someone mistakenly assumes that a characteristic of some or all the individuals in a group is also a characteristic of the group itself, the group "composed" of those members.

So when one thinks actions of a subset of a group represent the behavior of the whole group, they are committing the fallacy of composition.


Generalizing, or generalization is another term you could use.


"Tarring with a broad brush" is a very old idiom implying that bystanders are receiving the negative consequences ("tarring and feathering") properly applied to only the wrongdoers or that the consequences are out of proportion to the crime.

A brief search has the idiom as "tarred with the same brush" so maybe I am misremembering it.