The Parallel Between Gravity and Electrostatics

The electric field E plays the same role in electrostatics that g does for gravity.

For two masses (m and M) separated by a distance r:

F =
G m M
r2

In a uniform field F = mg

For charges:

F =
k q Q
r2

In a uniform field F = qE

The force equations are similar, so the behavior of interacting masses is similar to that of interacting charges. Charge plays the same role for electrostatics that mass plays for gravity.