static const size_type npos = -1;
The constant is the largest representable value of type size_type. It is assuredly larger than max_size(); hence it serves as either a very large value or as a special code.
size_type
max_size
()