The physics
Any two masses pull each other. The pull grows with each mass. It falls with the square of the distance between their centres.
F = G m₁ m₂ / r² G = 6.67 × 10⁻¹¹ N·m²/kg²
G is tiny, so Cavendish used a torsion balance. A thin fibre holds a rod with a small ball at each end. Lead balls pull the small balls sideways, and the fibre twists.
The fibre pushes back with a torque κθ. The rod stops when that torque equals the pulls' torque. A mirror on the fibre throws a light spot on a far scale. So even a tiny twist moves the spot a long way.
κ θ = 2 F × arm
A ball's weight is the Earth's pull on it. So mg = GMm/R², and the Earth's mass follows from g, R and G.
M = g R² / G ≈ 6 × 10²⁴ kg
Pulls add as arrows. A ball with a hole pulls like the full ball minus the missing ball. To compare two bodies, compare their M/r².