Cast iron has a lot of desirable properties for lots of applications. There are a few types of cast iron that have been tailored to fit applications but most maintain similar properties.
Cast iron is typically higher in carbon content and thus has additional lubricity - you will see lots of machines with steel shafts in cast bearings, piston rings, cylinder liners (as noted engine blocks) etc.
Gears are made from Cast Iron for the lubricity but cast iron is also hard and durable, runs quieter and absorbs shock loading
Cast iron is easy to mold and"cast" compared to other alloys - and is pretty much the first iron off the line during the production process.
Cast iron is hard so it makes for durable surfaces - table tops, liners etc
You have like - Grey cast iron - most used and has great compressive strength
White cast iron - hard surface but kinda crap for other applications
Sperodial grafitic - used for piston ring and such where you want a bed-able cast iron that has ductility and good elasticity
Casings and stuff will be mostly cast iron on the old tools - mass is essential to absorb vibration. you will notice that most cast iron parts are large to absorb the forces that would destroy them and add mass to the machine - like a tail stock could be a steel tube on a tripod but the cast iron adds solidity, absorbs vibration and lubricates the spindle. Also easier to form and machine to spec.
Cast iron = cheaper as well hence its use for gym weights (that would be the white type) and other applications like cannon balls (LOL) things like pipe wrench handles etc
Lots of applications..............................................