Hello Leane,
Thank you for the question.
As you might already know, the vector data structure as defined in C++ STL has a dynamic size unlike a standard array (it can shrink or extend at runtime). It is also allocated in a fixed memory space with a limited capacity even if the size is dynamic (check the capacity method in the vector). This result in the need of relocating the whole vector in larger memory region from time to time and copying all its elements to a new place. This copying operation is what cost O(n), but luckily, the need for reallocation and copying does not happen very often as the number of push_back operations; thus, we assume that the push_back has an amortized cost of O(1).
Ali