Tadalafil works by increasing blood flow to the penis during sexual stimulation, facilitating an erection. It does this by inhibiting the enzyme phosphodiesterase type 5 (PDE5), which allows for increased levels of cyclic guanosine monophosphate (cGMP) in the body. This relaxation of the smooth muscles in the blood vessels in the penis leads to increased blood flow, resulting in an erection.