I really don't know what to tell you. The word flexible is flexible :) The subject is so big.
There are many circumstances when you consider using polymorphism, and it is not used alone and is rarely the only option under consideration:
- allows you to componentize a system, which improves the software architecture
- provides run-time genericity, which as with all genericity, improves reusability and decreases code duplication
- supports certain language idioms
- provides alternative to using callbacks when single callback message is not adequate
And others.
I don't know what interests you - the technical, instrumental, conceptual value of polymorphism.
Here is a very generic example. You have container document for different types of objects. The objects and the document can be visualized and the user can interact with them. Each has its own visualization operations, user input callbacks, etc. The container document has a common interface to all objects it hosts - be it table, picture, video, etc. It only has to be able to access the relevant functionality - delegate the response to some of the user actions to the objects using the designated callbacks, call the visualization procedures of the objects when it needs to draw its own canvas, etc. The interface can be provided in some abstract base class from which all host-able objects derive. The flexibility comes from the fact that the layout, hit detection, input management of the container document are not concerned with the types of objects that it hosts. They may be containers in their own right (of the same or another variety). Consequently, you can add new types and thus extend the application, without modifying the code of the container. It will decide how to handle the objects at run-time, by connecting to their operations with polymorphism.
Don't make me code this particular example. It may take a week. If you really want some example, I can try, but the last post in which I used polymorphism is virtually non-digestible for beginner. If you want it (good or bad example, you decide) -
http://www.cplusplus.com/forum/general/37874/#msg203397
Remember though, that everything has certain price. Polymorphism (unlike templates and duck-typing) is relatively intrusive. It affects the type hierarchy and affects the future programming style. Also, you need to find the common denominator between different types of objects, which may lead to compromises with the efficiency and effectiveness of the solution.
Most design patterns (if you haven't heard of them) are centered around polymorphism. There are at least 20 or so of them, so it is a good place to start exploring. The above example (supposedly) incorporated a few.
Regards