There are many terms thrown around when talking about factory-built housing — manufactured home, mobile home, prefab, modular housing — and many of them are used interchangeably. These are all factory-built, but in some cases, there are important differences you should be aware of.
Two terms that actually do mean the same thing are manufactured home and mobile home. This refers to a home that was fully built in a factory and transported to the site whole, without any customization possible. The law varies by state, but in California, a mobile home must be registered with the DMV because it is a vehicle, not a house. There are legal provisions to consider it real estate if it is affixed to a foundation. In any case, being vehicles, mobile homes actually depreciate over time rather than appreciate. They also are not necessarily well-built to begin with, since the regulations that govern their construction are different and more lenient than the regulations for prefab housing.
Speaking of prefab housing, this is actually a category of types and not a single type. All prefabs have components that are built in a factory, then shipped to the site to be composed on-site. Modular housing is just one type of prefab, with the other being panel built housing. The modules of modular housing are large sections which can be quickly combined for more efficient construction, but they are less customizable than panel built homes, which are constructed one single panel at a time from the bottom up. Some prefabs combine both modules and panels to get the best of both worlds. Prefab houses are actually houses and are subject to the same rigors of quality as traditional stick-built houses, and may even be higher quality since they are factory-tested before being sold.