The black gunk that comes off a chain is largely ferromagnetic wear products from the chain. If you put your chain in a jar of solvent, shake it around, and place a magnet at the side of the bottle, you'll find black gunk attracted to and adhered to the magnet.
Cars are a bit different in that in addition to wear products, combustion byproducts make their way into the oil past the rings. Motor oils have detergents in them to keep these byproducts suspended.