Which force is greater over the distance between the earth and the sun?
Both forces decrease at the same rate, inversely with the square of the distance. The weakest of the four fundamental forces of nature is gravity. If the Earth were composed of all negatively charge particles and the Sun all positively charged particles, to orbit the Sun, the Earth would have to be at a distance of over 15 billion light years from the Sun. In answer to your question, the electromagnetic force is greater at any distance. Since the charges within the Sun balance out and also those within the Earth, they cancel and gravity is the force remaining and that keeps Earth orbiting. .