Tadalafil works by inhibiting the enzyme phosphodiesterase type 5 (PDE5), which is responsible for the degradation of cyclic guanosine monophosphate (cGMP) in the corpus cavernosum of the penis. By inhibiting PDE5, tadalafil increases the levels of cGMP, leading to smooth muscle relaxation and increased blood flow to the penis during sexual stimulation, which helps men achieve and maintain erections. In the case of BPH, tadalafil works by relaxing the smooth muscles in the prostate and bladder, which improves urinary symptoms.