Given: The speed of light in space is a constant; it does not vary (proven).
Given: Time near a large mass (e.g. Earth) is slower than time further away from a large mass (proven).
Given: velocity = distance traveled / measured time.
A clock on a GPS satellite will be about 500 picoseconds slower per second than a clock on Earth (Wikipedia's Gravitational Time Dilation). That's 1/50,000,000,000th of a second. The speed of light is about 300,000 meters per second. So space on Earth will be about 300,000/50,000,000,000 the volume of the space at the GPS satellite orbit: 3/500,000 meters or 0.000006 meters smaller (velocity = distance/time).
Since we know that time near a large mass is slower, and the speed of light is the same near a large mass as it is further away, then distance traveled must be less near a large mass. That is, space near a large mass is contracted to allow the speed of light to remain constant (mass affects spacetime). Whether mass affects time with a correction in space, or mass affects space with a correction in time, or mass affects spacetime, and how, is unknown.
The contraction of space (along with the slowing of time) near a large mass results in "gravity". Light photons bend closer to a large mass as they travel through space because massless photons have energy, and energy is equivalent to mass, and Newton's gravitation law is proportional to the product of two masses divided by the square of the distance between them. AND Einstein's General Theory of Relativity formula includes energy in a stress-energy-momentum tensor. Speaking of Einstein, we should use the term spacetime since space and time must be proportional to each other due to the constant speed of light. He used this term because he combined the 3 dimensions of space with time to come up with his mathematical formula for the General Theory of Relativity (really Gravity). Since he characterized spacetime as 4-dimensional, he could say that spacetime "curves" more nearer a large mass. This is equivalent to saying space contracts while time slows near a large mass. Either visualization works.
Astronomer Edwin Hubble famously declared that only the continuing expansion of space could account for the fact that the further that light had to travel from distant stars/galaxies, the greater the red-shift of light (Hubble's Law). Red-shift refers to the fact that even though light always travels at a constant velocity, its energy (measured by its wavelength/frequency) decreases as space expands. This is the same as light being red-shifted as it travels away from a large mass (like Earth), or blue-shifted as it travels closer to a large mass.
The current thinking about the origin of the Universe (the Big Bang) is that space expanded explosively (Inflation), and then gradually decreased that expansion. The effect of mass on space seems to account for the decrease (MAYBE the Big Bang resulted from the previous mass in the Universe coming together to form the ultimate black hole, which then turned into the ultimate pure energy, which then allowed space and time to once again fill out and begin again (no mass to contract and slow), and then with the expansion of space, the ultimate pure energy began turning back into all the mass in the Universe.
Since mass affects the expansion of space, and since space is still expanding, and as a result, the effect of mass on space is decreasing, MAYBE the expansion of space is accelerating even more because of the decreasing effect of mass on it.
MAYBE the way a change in spacetime causes "gravity" is that while electrons are "spinning" around an atom's nucleus at near the speed of light, the part that's closest to a large mass either has more energy or more velocity (or more time to get from where it was to where it's going) than the part away from the large mass, so they try to pull their atoms that way. Of course the person who's electrons are trying to go to the center of the Earth will simply feel his body being pressed down in that direction. OR maybe the "jiggle" of an atom (it only stops moving when the temperature gets to absolute zero), is the mechanism that tries to move atoms towards shorter time/smaller space. BUT then again it's obviously the mass of atoms that creates that shorter time/smaller space (somehow).
Don't think of gravity as a "force", but rather as how mass affects spacetime and is affected by it.
Magnetism is very similar to gravity, but it needs a moving electrical charge, along with the Special Theory of Relativity (electrical charges travel VERY fast), to exist. Relative motion at relativistic speeds causes an "apparent" change in positive/negative charge (number of electrons vs protons "seen" at any one time). Permanent magnets exist because all the electrons in a permanent magnet are oriented in the same direction, i.e. their electrical charges are all "spinning" in the same direction (VERY fast). I quotize spinning because physicists prefer to think that they simply have angular momentum, and use the term spin in a different way. So magnetism is simply the name given to how VERY fast moving or "spinning" electrons along with the Special Theory of Relativity affect other electrons.
Back to gravity. One way the expansion of space may possibly be stopped is with enough mass within an area of space. I believe this has already been found to be true by astrophysicists. The other way, MAYBE, would be if space has a final expansion size, and if that expansion size is reached, then this could lead to the beginning of a slow contraction of space since mass would still act on space.