It’s really simple, they are both radial fields with a 1/r potential, thus a 1/r² force.
Newtonian gravity is just a weak field approximation of general relativity, where you have very different equations, for example Einsteins field equations…
One electric charge creates an electric field, and another charge will interact with it, but the motion itself still depends on the mass of the second charge.
Matter instead curves spacetime itself, and the curved spacetime tells matter how to move.
Source: MS in physics.
It’s really simple, they are both radial fields with a 1/r potential, thus a 1/r² force. Newtonian gravity is just a weak field approximation of general relativity, where you have very different equations, for example Einsteins field equations… One electric charge creates an electric field, and another charge will interact with it, but the motion itself still depends on the mass of the second charge. Matter instead curves spacetime itself, and the curved spacetime tells matter how to move. Source: MS in physics.