What happens in these factories is anyone's guess. Apparently they make robots, as Canti is a Medical Mechanica robot and so are the many other robots he fights with in the anime. Haruko's attempts to get Atomsk results in her pulling lots of Medical Mechanica robots out of Naota's head, as she turned his head into a dimensional portal she can pull things out of.
The 'Medical' part of the title was partially explained when Canti displayed his ability to take X-rays, but why all the robots are huge and violent is not clear nor explained. What is explained is that Medical Mechanica eventually use the 'iron' factories to iron out the surfaces of the planets they are put on, as Commander Amarao puts it, "Ironing out the wrinkles in your brain so you can't think".
Side notes: Commander Amarao mentions in Episode 4 that there is a connection between the government and Medical Mechanica, though later on he states that Medical Mechanica is just as bad as Haruko and want to destroy all thought across the galaxy. In episode 5, Commander Amarao states that Medical Mechania sites from different planets send robots simply to destroy Haruko and Atomsk through Naota's head, implying that Haruko really is a Space Patrol Officer, and a deadly one. It is never explained how or why they captured Atomsk, though it may be assumed that he did not agree with their plans to iron out all thought and he tried to stop them.
In the series they could be considered the main antagonists.