The "Gang of Four" book talks about factory *method* and abstract factory. These names and descriptions are among the most confusing in the book. The discussion so far fits "factory method". we can leave "abstract factory" for another day.
When you get into larger and more complex systems, factories can offer a lot of freedom for future growth and change. If I code:
Widget w = new Widget(); w.someWidgetMethod();
my code is forever stuck with the class Widget. If I code:
WidgetInterface w = WidgetFactory.getWidget(); w.someWidgetMethod();
my code will work with any new class that implements the interface and we can configure the factory to give me different implementations based on the day of the week or changes in business policy or whatever. It's obviously more work to do this, but it decouples me from any particular Widget which might pay off big in the future.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi