How do physicists compare the relative strengths of the four forces?

It is the history of how the SU(3)xSU(2)xU(1) standard model of physics was built up making a consistent whole of the grand majority of data up to now, and giving good predictions.

A whole lot of scattering experiments showed that there were different strengths and different lifetimes in the interactions, and these are described with quantum field theory, where each interaction and decay is a sum of Feynman diagrams, starting from the first order,which gives the gross behavior, and going as far as calculations can be made or are needed of higher orders.

Feynman diagrams have vertices, and these vertices in the integrals represented by the Feynman diagrams have different strengths, coupling constants, which are shown in the table here.

funfor

The column "strength" is the value used in Feynman diagram vertices.

The first two, electromagnetic and weak, are the ones working well with the series expansion of the interaction into feynman diagrams. The lowest order are the exchanges of the gauge particles, that is why they are identified with the force (first column). QCD the strong force, can only be figuratively shown in Feynman diagrams. The actual calculations need different tools, because the strong coupling constant is 1. Lattice QCD is used for that. Gravity is not yet definitively quantized but there are effective quantizations.

In electromagnetic and gravitational interactions there exist mathematical tools that connect the classical constants with the field theoretical ones. Strong and weak interactions belong only to the study of particle interactions.

So , in a nutshell, it is the fitting of data with a specific standard model that organizes the particle interactions in line with four forces. For example see this summary..