Looks like you threw all the pieces on the table, expecting them to magically cohere, without the method in their madness that makes the standard model so special...
- I understand that the strong force overpowers the electromagnetic force, but how do we know for certain that quarks even have charges?
The 1990 Nobel prizes celebrate the deep inelastic scattering experiments of electrons on nucleons which proved that, in the late 60s and early 70s of the previous century. Analyzing the scattering profiles, it is possible to firmly deduce, "for certain", there are three charged quarks in the proton and neutron, exchanging virtual photons with the bombarding electrons thrown at them.
- Quarks clump together to form baryons due to the strong force, not the electromagnetic force.
Indeed, even though EM is weaker than the strong force binding such quarks, electrons, rarely, knock such off the nucleons and produce more hadrons, flying off in angles systematically dispositive of the established picture. A kinematic microscope of sorts.
The strong force and electromagnetic force appear to be directly related. Unless I am misunderstanding something, it appears that a particular arrangement of quarks leads to a specific kind of baryon that has a specific kind of electromagnetic behavior - meaning the strong force is indirectly leading to the behavior of the electromagnetic force.
You start the paragraph by asserting a direct relation, and finish it appreciating the relation is indirect: which is the proper perspective. The strong force binds charged quarks, and when, coincidentally, the net nucleon charge vanishes, the net electric force is zero. The net magnetic interaction is not, as the neutron has a huge, fat, magnetic moment. The charge of quarks is sort of like the hair color in dogs; not particularly "emergent" or otherwise deeply significant. Many particles have a charge or not, even leptons or gauge bosons which do not interact strongly.
The electromagnetic force is considered to be a separate force from the strong force--even though some speculative theories, GUTS, imagine them to be connected at fantastically high energies (the kinetic energy of a bus, all concentrated in a particle region) beyond our everyday experience or labs.
- I understand that quarks have electromagnetic charges, but I don't understand whether the cause for this is due to it "fitting into the math" or it actually being a fundamental property of the quarks.
I can't tell the difference between the two non-exclusive alternatives. The quarks are what they are, and they fit into the sudoku math Gell-Mann and Zweig (and others) discovered in the mid 60s. They are part of the astounding math (including anomaly cancellation) that was eventually appreciated about the standard model. Galileo said that "the book of nature is written in math". Once you study it, it should blow your mind...