a body of people gathered as one group, joined by a shared bond or common purpose
This is the word's home territory: a group of people considered as a single body. It comes from a root meaning to meet by appointment, so the picture is not a random crowd but people brought together and acting as one. Most often that body is Israel itself, gathered before God, deciding, worshiping, and bearing responsibility together. The word names the whole community as a unit, which is why a single leader can address it, a single sin can stain it, and a single judgment can fall on it.
The same word can also name a smaller body formed around a shared character or cause. Sometimes that body is good, such as a gathered circle of the upright. Often it is hostile: a faction that has banded together against God or against the innocent. The shift from the worshiping community to a gang of evildoers is not a different word but the same idea pointed in a darker direction, a group that has closed ranks for a purpose.
What holds these uses together is the sense of a unified group with a corporate identity. Whether the group is the whole nation, a circle of the faithful, or a pack of the wicked, the word treats them as one acting body rather than as scattered individuals.