Keep asking how and keep getting deeper into it and you hit a wall of “it’s a fundamental force”.
That's also how gravity works. Would you say "nobody know how gravity works"?
I'd argument we know more about magnetism, since it's not a fundamental force, it is part of the electromagnetic force / field, which is fundamental at normal energy levels. We also know what energy level is required to unify the electromagnetic force with the weak force to give the electroweak force / field, which is (last I checked) more than we know about gravity.
IIRC, the discovery of the Higgs proved that gravity does couple with other forces through the W and Z bosons, but my understanding that doesn't result in true unification at the energy levels we observed. But, I'm not a high-energy particle physicist, I just find the standard model fascinating.