Cancer can affect the liver either directly or indirectly. Primary liver cancers, such as hepatocellular carcinoma, originate in the liver itself. Secondary or metastatic liver cancers occur when cancer cells from other parts of the body spread to the liver. Both types can cause significant liver dysfunction by destroying normal liver tissue, obstructing bile flow, and altering metabolic processes.