There are quite a few definitions out there. Basically, the three common way of describing factory pattern are
Simple object creation method/class based on a condition.
The Factory Method design pattern using subclasses to provide the implementation.
The Abstract Factory design pattern producing families of related or dependent objects without specifying their concrete classes.
The below link was very useful - Factory Comparison - refactoring.guru