what algorithm does STL size() use to find the size of string or vector in c++ : what algorithm does STL size() use to find the size of string or vector in c++?

I know that working of strlen() is dependent on finding the NUL character in the c char array but I want to know how does size() function work to find the size of string which is not null terminated as we know.

Does stl containers use some sort of pointers to mark the ending of container?
And does that help in finding the size or something else?