The Ore Cannon was built on the planet Raxus Prime.
The use of the cannon was to send spheres of either ore or recovered metal to an awaiting space station in orbit above it, by means of a giant rail-gun array. This was similar to the garbage pit cannons used to launch refuse into space.
It was established as part of a system of smelting the scrap metal covering the planet, reforming it into spheres and sending it to the orbital shipyard for refining and use.
The Ore Cannon was sabotaged by Galen Marek, by supercharging the magnetic emitters on the rail gun. This caused the cannon to "fire" the ore sphere at a much higher speed than it was designed for, causing it to collide with and destroy the Star Destroyer production facility in orbit. The cannon itself was destroyed when Galen Marek pulled the lone surviving Star Destroyer down to the planet's surface, by means of the Force, annihilating both the cannon and the destroyer.