A factory is useful if you want to "harmonize" the creation of different objects (in your example Mouse and Hamster) through a shared Factory. This can be used to (a) abstract away specific Constructor-details for each subclass of a common super class (e.g. Animal in your example) or (b) providing default arguments to a Constructor depending on which type of object (or animal) is to be created.
It can be used to unify the creation of objects sharing a commonality, e.g. in caching: CacheFactory -> Memcache, Filecache, ... Working with each cache is similar, but setting up different caching strategies may differ vastly. When using the factory method you can switch between different caching strategies more easily, at best by just chaning one line of code factory("Memcache", options),without having to worry about the intricacies of the specific backend;