Because the do_copy function is declared virtual, it calls the version that is "lowest" in the inheritance order, which in this case is the do_copy function from the derived class.
This is quite important, for example, you had an array of base_class objects, which were all different child clases in reality (eg. derived_class1, derived_class2, derived_class3). If it didnt call the "lowest" version of do_copy you would have to manually cast each object to the correct class before calling do_copy. But the virtual ensures that the correct function is called.
The function must be declared virtual in the base class. if the function is overridden locally, it still remains virtual even if it is not explicitly typed (because it was declared virtual in the base class).