The behavior of quarks and their interactions in subatomic particles is governed by the fundamental forces described by the theory of quantum chromodynamics (QCD). In the case of a neutron, which consists of three quarks (two down quarks and one up quark), their charges do not directly lead to immediate annihilation because the properties of the strong nuclear force play a crucial role.
In QCD, the strong nuclear force is mediated by particles called gluons. Gluons carry a "color charge" that interacts with quarks. Quarks have three types of color charges: red, green, and blue. The interaction between quarks is such that they tend to form "color-neutral" combinations. In the case of a neutron, the combination of two down quarks (one red and one blue) and one up quark (green) results in a color-neutral state.
The strong nuclear force is a confining force, meaning that it becomes stronger as quarks are pulled apart. This prevents the individual quarks from freely existing in isolation. As a result, the positively charged up quark in a neutron is not directly able to annihilate with the negatively charged down quarks because they are bound together by the strong force, forming a stable composite particle.
Furthermore, the concept of matter and antimatter annihilation is primarily associated with the electromagnetic force and the weak nuclear force, not the strong nuclear force. While the electromagnetic force does play a role in some particle interactions, such as electron-positron annihilation, the strong nuclear force is dominant in the interactions between quarks within a neutron.
In summary, the stability of a neutron and the lack of immediate annihilation between its quarks can be attributed to the confinement of quarks by the strong nuclear force and the formation of color-neutral combinations of quarks.