Based on Einstein's theory of general relativity, gravity is the curving of space-time by any object that has mass. Think of space-time as a rubber sheet. If you place a heavy object on it, it will bend the rubber. If you place a ball on the sheet, the curved surface will make the ball roll toward the heavier object. That's how gravity works in the four dimension of space-time.