How are electromagnetic forces and gravity alike?
Are only superficially similar, in reality they are very different.
Electromagnetic and gravitational forces are very different.
The Newtonian force of gravity is expressed as
and the Coulombian electric force is
Then for a long time physicist thought that the two forces were somehow similar.
Later, we discovered that the newtonian force is the approximation of the general relativity when the curvature of the space is almost flat (low gravity) and that the electromagnetic force is an approximation of the quantum electrodynamics when the density of energy is low enough to consider it classics.
In particular the gravity is a theory very different from any other field theory. The electromagnetic force, the nuclear weak force and the nuclear strong force are all described in terms of an exchange of particles. It means that the distant action is in reality the transport of a particle from the source to the destination.
So for example two electrons that repel each other, are exchanging photons to create the force.
The gravity does not follow this mechanism. It bends the space and time forcing the object to have trajectories that follow the new space-time.
It is still under heavy discussion the existence of a theory that can unify the languages and create an universal description of gravity and the other forces, but nobody found it so far.