According to the standard model of particle physics, the nucleons are composite particles, made of quarks. The proton is composed of two u quarks and one d quark, while the neutron is made of two d quarks and one u quark. In the same fashion, the pions (pi-mesons) are made of two quarks, more precisely one quark and one anti-quark. No free quark has ever been found.
In quantum electrodynamics (QED), the force between the electric charge is carried by virtual photons. In quantum chromodynamics (QCD) (the theory of the nuclear force) the gluons are the carrier of the force between the quarks. Thus the nucleons are bound by a continuous exchange of virtual gluons between the quarks, just as the atoms are bound by an exchange of virtual photons between the nucleus and the orbital electrons.
Nevertheless there are important differences between the photons and the gluons. There is only one variety of photons but eight different varieties of gluons. Furthermore, the photons do not interact between themselves; they are not affected by the electric force that they carry. The consequence is the familiar fact that the EM force between two charges decreases with the inverse square of the distance.
On the contrary, since the gluons feel the colored force that they carry, they interact with each other. (This different behaviour is an effect of group theory. The QED and QCD theories are based on different groups. The three-fold internal symmetry of QCD imposes this self-interaction which is absent in the one-fold internal symmetry of QED). This interaction brings a bunching of the field-lines of force between two quarks. This bunching increases the force as the distance increases. The force is approximately proportional to the distance between the quarks.
At very small distances (less than one fermi = 10-13 cm; the radius of a nucleon) the quarks do not feel each other and behave as free particles. This is called asymptotic freedom. This property is revealed by high energy collisions (above one GeV) corresponding to small interparticle distances.
If we try to separate two quarks bound in a pion, we find that we have to invest an amount of energy increasing with the square of the distance, corresponding to the potential energy between two quarks. Around one fermi, this amount of energy becomes larger than the mass of a pion. The initial pion simply splits in a pair of pions quenching our hope of creating free quarks.