Both Factory and Builder patterns are creational design patterns.
They are similar in nature but Factory pattern is a simplified generic
version of Builder pattern.
We use Factory pattern to create different concrete subtypes of an
Object. The client of a Factory may not know the exact subtype. E.g.
If we call createDrink() of a Factory, we may get Tea or Coffee
drinks.
We can also use Builder pattern to create different concrete
subtypes of an object. But in the Builder pattern the composition of
the object can be more complex. E.g. If we call createDrink() for
Builder, we can getCappuccino Coffee with Vanilla Cream and
Sugar, or we can get Latte Coffee with Splenda and milk cream.
So a Builder can support creation of a large number of variants of
an object. But a Factory can create a broader range of known
subtypes of an object
https://stalk-calvin.github.io/blog/2016/10/15/builder-pattern.html