In some senses, you can look at like a planet orbiting a sun, but in reality that metaphor will fall through. It may not be moving at all in the conventional sense.
Gravity is seen as one of the basic 4 forces. Electromagnetism (electricity and magnets are seen as 2 sides of the same coin), gravity, Strong, and Weak.
This may sound mind-blowing, but we actually understand very little about gravity. There is even a big argument over how fast gravity travels- for example, if the sun were suddenly yanked away from the center of the solar system by an inconceivably huge rope, how long would it take for the Earth's orbit to change? There have been some various evidence, the best evidence shows much faster than the speed of light but apparently still not instantaneous.
The irony is that while gravity is the most obvious force you sense every day, it's also one of the weakest. It's hard to get a readable force from a lab experiment because the gravity from even a 10-ton sphere of iron is still phenomenally small. With magnetism we can make a concentrated field with an electromagnet, not so with gravity.