Gravity is not the metric, but it does interact with the metric (well, gravity is what we call it when mass or energy affects space time). The presence of mass/energy causes the shortest distance between two points to no longer be a straight path through space. The path an object takes through space time is always the path with the shortest space time interval among all paths (in that sense the path is “straight” the same way that in flat space, a straight line is the shortest path between two points) — this distance is given by the metric tensor — but gravity makes this path appear curved in space.
When you have a space that isn't just normal globally euclidean space (such as: on the surface of a sphere), the idea of a vector as in like "a direction you can go in and an amount of how much or how fast or whatever" isn't something that makes sense as something independent of a base location. Instead, each point in the space has associated with it a space of "tangent vectors" at that point, and these spaces are related to each other.
The metric tensor associates to each point a "bilinear form" with some properties, essentially a way of doing something like a dot product of two tangent vectors at that same point.
This in turn allows for defining the notion of the length of some curve through the manifold.