According to the special theory of relativity, mass is nothing but entrapped energy. If that is true what traps the energy and how they have very different properties?
Mass is not entrapped energy.
In special relativity one sees that the energy of a particle can be written as sum of two contributions: one corresponding to the "true" kinetic term (i.e. the velocity) and one constant term proportional to the mass of the particle, namely $$ E = E_0(m) + E'(v) $$ where for the moment we neglect any potential energy term for the sake of simplicity. The consequence of such equation is that in scattering processes, i.e. whenever two or more particles interact (and especially in processes of fusion and fission), those terms can contribute to the final momentum or mass of the eventual scattering products in any way - as long as the total energy is conserved. One refers to this phenomenon by saying that mass can be "converted" into pure kinetic energy and viceversa.
One might think that the term $E_0$ proportional to the mass is constituted by summing up all the binding potential energy interactions of the elementary constituents of the particle. However, even in that case, the elementary constituents of the particle have their own rest energy that cannot be split any further.
Let me disagree with the other answer.
You are asking whether mass is just entrapped energy. Let me give you a more QM answer. Imagine a photon box, with massless mirror walls. The clock itself is massless. Though, since the photon constantly hits the side walls (mirrors), the photon exerts pressure on the mirrors, and gives the box itself wight (rest mass).
Our currently accepted theories, the SM, together with QM and GR, all fit the experimental data, and based on these, we do have elementary particles, some of them with and some without rest mass. Now normal matter around us, is built up by atoms, that are built up by fermions, electrons, and quarks.
Rest mass (most of it) arises from the confinement of massless objects, like photons and gluons.
Either way, one can see that a great deal of the "rest mass" in the World indeed arises from the confinement of massless objects, as discussed further in my answer here and here.
Please see here:
As per our accepted theories, neutrons and protons that make up the nucleus, are made up by a sea of quarks and gluons.
Now the rest mass of these nucleons comes mostly from the gluons energy (from the strong force). Quarks and gluons are in confinement, which is as you say entrapment, of energy.
Still, as per the SM, quarks, and electrons, that make up the atom, are point particles, with no spatial extension, no internal structure.
The electrons does have a rest mass, and its rest mass does not change. But the electron is again a good example of entrapping energy, since whenever it absorbs a photon, the electron's kinetic energy rises. In theory the electron is able to absorb multiple photons, and this can be interpreted too as a way of entrapping energy.
Though, quarks and electrons are point particles, and as per the SM, are not made up of anything smaller.
So our everyday matter is made up of these, and most of the atom's rest mass is made up of the binding energy of its constituents, and most of the nucleons rest mass is made up of the gluons energy (strong force) that holds the nucleons together.
Most of the rest mass is entrapped (confined energy).
Still, there is a part of the rest mass, that as of the SM, is an intrinsic value of the electrons and quarks.
Maybe some day, when string theory proves to be right, we will be able to say that even these (quarks and electrons) are made up of just entrapped (confined) energy.