
Quite regularly one will come across a website, blog or some thread on a forum that says the gravity is just electromagnetism. For sure they are not the same. However, I am not sure what would constitute the ‘nail in the coffin’ for all these clams. 
With this in mind, I am not going to try to debunk every such claim. However, I think the reason for this seeming equivalence comes from the static limit. In this limit it is true that there are many formal similarities between Newtonian gravity and electrostatics. In fact there are many formal similarities in the full classical theories, both are very geometrical in nature, but I won’t go into details here.
I just wanted to point out one very clear difference between gravity and electromagnetism that can be seen in this static limit. That is the lack of a generalisation of the equivalence principal for electromagnetic theory. This principal in gravity is very important and one that I will comment on in due course.
The static limit
I am guessing that we have all seen Coulombs law for electrostatics and Newton’s law for gravity. Let me just write them down
$latex F = k \frac{qQ}{r^{2}}$,
where $latex k$ is Coulombs constant, it is a measure of the strength of the electrostatic force and $latex q$ and $latex Q$ are the electric charges of two point particles. The above expression is the electrostatic force between two such charged particles.
Similarly we have Newton’s law of gravity
$latex F = G \frac{mM}{r^{2}}$,
where $latex G$ is Newton’s constant which measures the strength of the gravitational force and $latex m$ and $latex M$ are the masses of two point particles. The above expression measures the gravitational force between these particles.
These expressions for the forces should be seen as the static nonrelativistic limit. I just mean that as long as the particles are moving slow enough then the change in the fields can be viewed as instantaneous. This is okay for many applications, but it is not the full picture. However, it is the one you see at high school.
The formal similarities at this level are clear. You just need to swap constants and interchange charge and mass. But this does not mean they are the same, and there is a subtle issue here. Before that we need Newton’s law of motion
Newton’s second law
Newton’s second law tells us that the force exerted on a particle is proportional to the acceleration of that particle. Moreover, the constant of proportionality is the (inertial) mass.
$latex F = m a $.
That is all we will need.
The gravitational equivalence principal
Let us think of the particle of mass $latex m$ as a test particle. That is we will think of how it is moving in the gravitational field generated by the particle $latex M$ and that it does not generate a gravitational field of its own. This approximation is good for small objects moving in the gravitational field of big objects; say planets around a star or satellites in orbit around the Earth.
Now we can examine how the small mass is influenced by the big mass. We should just equate the two expressions due to Newton
$latex ma = G \frac{mM}{r^{2}} $,
for which we can solve for the acceleration
$latex a = G \frac{M}{r^{2}}$.
We notice a very amazing thing. The small mass cancels from both sides of the equation. (We assume that gravitational mass and inertial mass are the same. This seems to be case in nature.)
This means that the motion of the test particle does not care about any of the intrinsic properties of that particle. The only things it does care about is the initial position and velocity. This is one form of the equivalence principal which has it’s roots in the experimental work of Galileo acceleration of a test particle due to gravity is independent of the mass being accelerated.
Thus, really all the information about the test particles motion is encoded in the gravitational field alone. All test particles whatever their mass will behave the same. This is the clue that gravity can be formulated very intrinsically in terms of spacetime geometry alone; this leads to general relativity which is not the subject for today.
The electromagnetic version
Now let us play the same game with electrostatics…
$latex ma = k \frac{q Q}{r^{2}} $,
where we think of the test particle $latex (m, q)$ moving in the electric field generated by the particle $latex (M,Q)$. Now solving for the acceleration gives us
$latex a = k \left(\frac{q}{m}\right) \frac{Q}{r^{2}} $.
Now we see the difference. The motion of the test particle does depend on the intrinsic properties of that particle, namely the chargemass ratio. There is no similar statement like for gravitational physics; there is no equivalence principle.
Closing remarks
Everything above is done in a particular limit of the full classical theories. The same picture is true when we examine the motion of test particles in general relativity and the Lorentz force in electromagnetic theory. I have chosen these limits because I think this is clear and also the source of the instance that gravity is just electromagnetic theory. I have pointed out one clear and explicit difference.
One can do the same with Coulomb’s law for the magnetic force. Although magnetism is a bit more complicated we can examine the situation for pointlike poles. This is okay for small enough poles that are well separated. You will reach the same conclusion that there is no equivalence principal in this situation. Thus, gravity is not magnetism either.