The magnetic organism was a malevolent lifeform. A form of primal energy, it had no mass, but seemed to display a Magnetic flux, which increased as it grew stronger, and which seemed to fluctuate in a steady, almost pulsating rhytm not unlike the beating of a heart.
It was capable of symbiotic relationship with a host body, a starship for instance. When doing so it would utilize the electronic control systems of a starship like a man used the neural control systems of the human body, and thus essentially become the starship. It was also believed capable of reproduction, by mitosis.
It was encountered at a dead star by an Ancient insectoid starship 300 million years ago. The crew determined it to be malevolent, and rather then risk spreading to other world, they destroyed their ship.
The creature survived on the ship's dead hulk, until it was encountered by the USS Enterprise in 2269. It managed to take over that ship, its crew serving in its body like the white corpuscles in human blood. It then ordered the ship to set course to the heart of the galaxy.
The Enterprise crew managed to set a slingshot course round the dead star without the organism's approval. Believing they were about to destroy the ship, it evacuated it for the dark star, but the Enterprise activated warp drive and escaped the Hypergravity of the object, leaving the organism stranded again.