I will give a slightly different take based on the first university level book on gravitation I read many years ago - simply called - Gravitation and Space-Time:
https://www.amazon.com/dp/1107012945/?tag=pfamazon01-20
You probably have heard of Coulombs law:
https://en.wikipedia.org/wiki/Coulomb's_law
Well there is an issue with it and relativity. You probably have heard that in relativity nothing can move faster than the speed of light:
https://en.wikipedia.org/wiki/Special_relativity
So let's move a charge, then according to Coulombs law the field moves instantaneously even many miles away. But since nothing can move faster than light this can not be correct. One can fix this up by carefully analysing what a theory that takes into account relativity would be like. It's advanced but just to show it can be done here are the details:
http://www.cse.secs.oakland.edu/haskell/Special Relativity and Maxwells Equations.pdf
These are the so called Maxwell's Equations and are the correct equations of an electric field that fixes the problem with relativity. It also introduces a new field - the magnetic field - which you undoubtably have experience with using bar magnets etc. Light, radio waves etc are all forms of electromagnetic radiation from the fact Maxwell's equations show accelerating charges actually radiate EM fields. It is the basis of all our electrical technology, and the bread and butter of any electrical engineer.
You also have probably heard of Newtons law of gravitation:
https://en.wikipedia.org/wiki/Newton's_law_of_universal_gravitation
Notice it is similar to Coulomb's law and has exactly the same problem. So by looking at Maxwell's equations, in an analogous way we can fix up Newtons law of Gravitation, and you end up with what is called linearised gravitation. It predicts all sorts of new effects such as the bending of light around the sun, slight discrepancies in the orbits of planets etc - all of which have been confirmed by experiment. Great - you think that's it. Well not quite - when you analyse linearised gravity you find a problem. It says all matter and energy can be a source of gravitation. But there is a powerful theorem called Noether's theorem that says fields themselves should have energy (the following is a bit about Noether and her beautiful theorem that is now so fundamental to much of physics):
https://www.vox.com/2015/3/23/8274777/emmy-noether
So that means the gravitational field itself should act as a source of gravity - sometimes called gravity gravitates. Hence linearised gravity, which does not take this into account, can only work when gravitational fields are weak and this can be neglected. So we need to fix this up. In doing this we find something very interesting about linearised gravity. It acts as if space-time had a very small curvature. So, to fix it, we try to find the equations of space-time with an arbitrary curvature and hope that will get us out of trouble. It turns out linearised gravity has a rather strange property - only one set of equations with arbitrary curvature exists that reduce to linearised gravity when the field is weak - the so called Einstein Field Equations, and it turns out those equations do indeed include gravity gravitating. Changing the perspective to gravity being space-time curvature in an intuitive sense makes the problem go away. These are the equations of General Relativity that Einstein and independently the great mathematician Hilbert discovered. But Hilbert, being a mathematician, magnanimously gave the credit to Einstein because as he said 'every child in the streets of Göttingen knows more about four-dimensional geometry than Einstein', but it was Einstein's physical insight that got him to the key ideas, and hence deserved the credit. However they did it by different means than I described above. Indeed if you asked a slightly different question - what is the simplest explanation of our current theory of gravity - I would have explained it more in line with the usual presentation - but the above shows how science progresses by finding issues with current theories and tries, in a reasonable way, to fix them. How Einstein/Hilbert did it you will find in most books on General Relativity - the book I got this from is the odd one out. Einstein had the uncanny ability to deeply penetrate issues in physics and this led him to a different way of solving it using thought experiments with elevators etc - not the clean logical way I presented it. But what I described above I think answers your question better. Namely its the reasonable consequence of trying to fix up Newtonian gravity in a way similar to fixing up Coulomb's law.
There is an issue with asking in science how does something like electricity or gravity work. We have theories - which is what gravitational theory is - a theory. Every theory has assumptions. Sometimes you find those assumptions are 'wrong' like with Coulomb's Law and Newtonian Gravity, so have to be modified and based on different assumptions. Then you have a new and better theory - but it is still based on assumptions. Doesn't matter what you do you must assume something. So asking how does something fundamental like gravity work is to some extent meaningless - at rock bottom it's based on a theory and what it says is a consequence of the assumptions it makes. We constantly check those assumptions, and their consequences, against experiment to see if they are valid, logically consistent, in accord with other theories etc. So it's provisional and hence can't be said to be how gravity works - it's simply a model that explains all the observations/experiments etc we currently know. But physicists are like everyone else, sloppy on occasion, and will say things like space-time curvature is how gravity works. But now you know what is actually going on in science and recognise that is not strictly true.
Thanks
Bill