Tamoxifen is metabolized in the liver primarily by cytochrome P450 enzymes, resulting in the formation of active metabolites such as 4-hydroxytamoxifen and endoxifen. These active metabolites retain the ability to bind to estrogen receptors, contributing to its therapeutic and toxicological profiles.