formula for gravitational force shows it is inversely proportional to the distance between two masses squared this is similar to the electrostatic force thay changes according to the separation squared.
The difference is that gravity is proportional to the product of the two masses. Electro static force is proportional to the product of the two charges.