Baricitinib functions by inhibiting JAK1 and JAK2, enzymes that play a crucial role in the signaling pathways of cytokines and growth factors. These pathways are often dysregulated in cancer, leading to uncontrolled cell proliferation and survival. By targeting these enzymes, baricitinib can potentially disrupt the growth and survival of cancer cells.