Depends if by factory you mean machine-built ‘traditional’ wheels(normal rims, hubs, spokes, 3-cross) or something like a cross-max.
A lot of the time when people say factory they mean an ‘un-traditional’ design like the cross-max. Like with buying anything ‘all in’, if you like all the components then great, and some of those wheelsets do seem very good value. On the other hand if you prefer to spec the different parts yourself, obviously a ‘traditional’ wheel is the way to go – providing you get it built by someone you trust.
As for hand vs machine built, I know little about the machines that build wheels but my experience with seeing some of these come into a shop is that they are far from infallible. In the shop I worked at lots of wheels that came in, on new bikes and otherwise, often needed a little trueing. They weren’t far out, and not unsafe, but weren’t as true as a good wheelbuilder would have built them(especially once you’d stressed them).
I’d have assumed smaller production runs and tighter quality control might mean some factory wheels are handbuilt anyway?
I’m pretty sure that at least one part of the process for XTR wheels is done by hand?
Edit: Bit on Shimano’s wheel factory here.
Each and every wheel is fully handbuilt all the way from initial lacing to final true and tension. Vertical and lateral runout for each serialized wheel is individually recorded, which also means that each one can be traced back to a particular builder, date, and material batch. This yields obvious dividends for Shimano’s enviable quality targets (the non-conformance rate is said to be less than 0.03%), but it also plays a less obvious role that is no less important. According to Shimano, the ‘feel’ of human hands simply can’t be matched by a machine when it comes to the black art of wheel building. Moreover, attaching a name to each wheel instills a sense of pride and personal accountability.
…
Naturally, each Dura-Ace wheel is handbuilt as well, but in a wholly separate area of the facility reserved for Shimano’s most experienced and talented builders. Much as Dura-Ace represents the pinnacle of the Shimano wheel line, the prestige of being a Dura-Ace wheel builder is a highly sought-after position within the ranks: the room more closely resembles a showroom than a factory, it’s pleasingly quiet, and unlike the main wheel building area, it’s also air conditioned.