The design rationale behind the resize method of std::vector is to allow dynamic adjustment of the number of elements contained in the vector. It provides two primary benefits.
One benefit is that it lets you adapt the vector size according to your application's needs. For example, if you are collecting data over time that needs to be stored in a vector, you can easily resize the vector by increasing/decreasing its size to accommodate the additional/removed data.
The other benefit is that it can improve performance by avoiding unnecessary allocations. Allocations are an expensive operation, so if you know the vector size beforehand, you can set the vector size to the exact number of elements needed, avoiding any unnecessary allocations later.
In addition to the above two primary benefits, the resize method is also designed to provide features that are specified by the C++ Standard Library (see section 23.3.6.4 of the C++17 Standard). It allows for a varied range of inputs for parameters, making it a much more comprehensive method than simple reimplementations of resize().
Overall, the resize method of std::vector provides a much more comprehensive solution to dynamically resizing a vector according to your application's needs.