Pions and gluons both play important roles in the strong nuclear force, but they have different functions.
The strong nuclear force is mediated by particles called gluons. Gluons are massless particles that carry the color charge, which is the charge associated with the strong force. They interact with quarks, which are the fundamental particles that make up protons and neutrons, by exchanging gluons between them. These gluon exchanges generate the force that binds quarks together inside hadrons (such as protons and neutrons) and ultimately holds atomic nuclei together.
Pions, on the other hand, are not the carriers of the strong force. They are actually composite particles made up of quark-antiquark pairs. Pions are part of a class of particles called mesons, which are composed of a quark and an antiquark. While pions are not directly involved in carrying the strong force, they are influenced by it.
Pions are involved in the residual strong force, also known as the nuclear force, which is a residual effect of the strong force acting between nucleons (protons and neutrons) within atomic nuclei. This residual strong force is responsible for binding nucleons together despite the repulsive electromagnetic force between protons. Pions are exchanged between nucleons, contributing to the strong nuclear force and facilitating the binding of nucleons in atomic nuclei.
So, while gluons are the fundamental carriers of the strong force between quarks, pions play a role in the residual strong force that acts between nucleons in atomic nuclei.