Trimethoprim exhibits selectivity by preferentially binding to bacterial dihydrofolate reductase over the human form of the enzyme. This selective binding is due to subtle differences in the enzyme's active site between different species. The structural differences allow trimethoprim to bind more tightly to the bacterial enzyme, thus making it an effective antibacterial agent while minimizing effects on human cells.