Metric is a linear machine that takes two vectors and produces a number.
In STR, the spacetime is flat and thus one can define position four-vector $\Delta\vec{r}=(\Delta t, \Delta x, \Delta y, \Delta z)$ between two events and compute its inner product:
$$g(\Delta\vec{r},\Delta\vec{r})=-\Delta t^2 + \Delta x^2+ \Delta y^2+ \Delta z^2.$$
I am using Minkowski coordinates.
The inner product of any vector tells you its "square magnitude", in case of position vector it is squared distance between two events, i.e. spacetime interval.
So basically, metric determines spacetime interval between two events by applying it on position vector that connects these two events. But metric can be applied on any two vectors, so it is much more general and powerful object than simple spacetime interval, which tells you only squared distance between two events.
In general relativity, there is a complication that there are no position vectors in general curved spacetime. But there are position vectors in an infinitesimal neighborhood of any event, so locally the above description is still applicable. Globally though, the spacetime interval starts loosing its meaning and we need to start talking about lengths of curves between events instead of spacetime intervals, but metric is still a well defined machine that can be applied to any two vectors of its tangent space.