This video did not explain properly. For vectors, insertion may cause reallocation of memory to different set of contiguous memory (since vectors are dynamic arrays) and if you insert an element the system will have to copy the whole vector to a new location with some empty memory at the end to allow further size change without copy. When that happens the whole vector gets invalidated. That is what happened here. Otherwise if this would not have happened, e.g. when insertions are done when there is space remaining *it would have given 100 and iterator would not have got invalidated and only the end iterator of the vector would have got invalidated cause itis now not pointing to the end. Invalidation means that you can now not access the vector properly using the iterator.