Why do quarks and antiquarks tend to bond in groups in which the number of quarks minus the number of antiquarks is divisible by 3? Why do quarks and antiquarks tend to bond in groups with quark number a multiple of 3?
I understand why they might in bond in groups of three to create a net charge of zero (i.e. neutrons), but I don't understand why they form protons and not, for example, commonly form in groups of four. I have done background research on this question, and did not find any information. The wikipedia article on baryons (https://en.wikipedia.org/wiki/Baryon) was not helpful either.
To summarize, why are mesons and baryons more common than other hadrons?
 A: Anything made of quarks must have net color neutrality.
Quarks come in the following 'colors': red, blue, and green. All three combine to be color neutral

Antiquarks come in the following 'colors': antired, antiblue, and antigreen. All three combine to be color neutral

Colors and their anticolors combine to be color neutral (i.e. red and antired combine to be color neutral)
Hence...

*

*One quark cannot be color neutral

*Two quarks cannot be color neutral

*One quark and one antiquark can be color neutral [meson]

*3 quarks can be color neutral [baryon]

*Two quarks and two antiquarks can be color neutral [tetraquark]

*4 quarks and one antiquark can be color neutral (three colors + color/anticolor) [pentaquark]

You can see that singular quarks and diquarks are not possible and that baryons and mesons are simpler in structure, hence, more common.
A: Each quark $q$ and antiquark $\bar{q}$ transform in the fundamental representation ${\bf 3}$ and antifundamental representation $\bar{\bf 3}$ of the color group $SU(3)_C$, respectively.
However, a hadron has to be a color singlet ${\bf 1}$, due to color confinement.
In particular the center
$$\mathbb{Z}_3~:=~\mathbb{Z}/3\mathbb{Z}~=~\{1,e^{\pm 2\pi i/3}\} ~\subseteq ~SU(3)_C$$ of the color group $SU(3)_C$ should be in a trivial representation of the cyclic group $\mathbb{Z}_3$. This precisely happens if the quark number is a multiple of 3. This answers OP's title question.
Examples:

*

*A single quark $q$ transforms in the fundamental representation ${\bf 3}$ of $SU(3)_C$, and is hence not allowed. See also related Phys.SE post here.


*A diquark $qq$ belongs to the tensor representation ${\bf 3}^{\otimes 2}:={\bf 3}\otimes{\bf 3}\cong\bar{\bf 3}\oplus{\bf 6}_S$, which we have decomposed in irreps of $SU(3)_C$. This contains no singlet ${\bf 1}$, and is hence not allowed. See also related Phys.SE posts here and here about $SU(3)$ tensor representations.


*In a meson, the quark-antiquark-pair $q\bar{q}$ belongs to ${\bf 3}\otimes\bar{\bf 3}\cong{\bf 1}\oplus{\bf 8}_M$, which contains a singlet ${\bf 1}$, and is hence allowed.


*The third tensor product is ${\bf 3}^{\otimes 3}={\bf 3}\otimes{\bf 3}\otimes{\bf 3}\cong {\bf 1}\oplus 2\cdot{\bf 8}_M\oplus{\bf 10}_S$. In a baryon, the three quarks $qqq$ form a totally antisymmetric representation $\wedge^3 {\bf 3}\cong {\bf 1}$ of $SU(3)_C$, which is isomorphic to a singlet ${\bf 1}$, and is hence allowed. See also related Phys.SE post here. The lightest baryon, the proton, is stable in the standard model due to baryon/quark number conservation. (However, see the hypothetical proton decay.)


*The tensor product ${\bf 3}\otimes{\bf 3}\otimes\bar{\bf 3}\cong 2\cdot{\bf 3}\oplus {\bf 6}_M\oplus {\bf 15}_M$ contains no singlet ${\bf 1}$, so the combination $qq\bar{q}$ is not allowed.


*The fourth tensor product is ${\bf 3}^{\otimes 4}\cong 3\cdot{\bf 3}\oplus 2\cdot{\bf 6}_M\oplus 3\cdot{\bf 15}_M\oplus{\bf 15}_S$. This contains no singlet ${\bf 1}$, so four quarks $qqqq$ are not allowed.


*A "molecule" of mesons and baryons, such e.g. a tetraquark $q\bar{q}q\bar{q}$ or a pentaquark $qqqq\bar{q}$, is also allowed, but is obviously heavier. See also related Phys.SE posts here, here, and here.
TL;DR: The number of quarks minus the number of antiquarks should be divisible by 3.
References:

*

*G. 't Hooft, Introduction to Lie Groups in Physics, lecture notes, chapter 10. The pdf file is available here.

