Labs do research. Factories either build buildings, build ships, or return their funding to the economy if neither ships nor buildings are being built on that planet.
However, a factory can do research and a lab build ships/buildings...but at a reduced rate. Therein lays the idea of all-x.
I gave the option about 1/49/50 split of mil/soc/res due to a 1:1 ratio of planetary focus of mil to soc and vice versa. At least in that split you are only running either set of buildings at 50% capacity, instead of the 33/33/34 split in which building is running at 66% and research at 34%.
Things get further complicated if you don't have your general spending slider at 100%...as everything then is further cut back from it's quoted ability.
Sliders=evil