The mass of a proton is not solely determined by the masses of its constituent quarks. The mass of a proton arises from various contributions, including the masses of the constituent quarks (which only account for a small fraction), as well as the binding energy from the strong nuclear force and the kinetic energy of the quarks inside the proton.
While it is true that the masses of the up and down quarks, which are the primary constituents of the proton, are relatively small compared to the proton's mass, they are not exactly massless. The up quark has a mass of around 2.2 to 4.8 MeV/c² (depending on the specific quark mass scheme used), and the down quark has a mass of around 4.7 to 5.8 MeV/c². In comparison, the proton mass is approximately 938 MeV/c².
The strong nuclear force, mediated by particles called gluons, plays a crucial role in binding the quarks together inside the proton. The energy associated with the strong force binding is significant and contributes to the overall mass of the proton.
Additionally, according to Einstein's mass-energy equivalence (E=mc²), the kinetic energy of the quarks also contributes to the effective mass of the proton. This kinetic energy arises from the quarks' motion and interactions within the proton.
Therefore, the mass of a proton is the result of a complex interplay between the masses of its constituent quarks, the binding energy from the strong force, and the kinetic energy of the quarks. While the masses of the individual quarks are relatively small, their combined effects, along with the other factors mentioned, lead to the observed mass of the proton.