Metabolism is how the drug is changed into different chemicals by the body
To measure how long a drug remains unchanged in the body, we use something called the half life. This is the time it takes for the concentration of the active drug to reduce by 50%.
The half life of ivermectin is just 18 hours [1, 2]. This is considered relatively short [2].
For example, if you took 1mg of ivermectin, after 18 hours, there would only be 0.5mg of ivermectin left in your body. The other 0.5mg will have been converted into other chemicals by enzymes.
Ivermectin is metabolised by enzymes in the gut and liver [1, 3]. In particular, an enzyme called cytochrome P450-3A4 from the liver can change the chemical properties of ivermectin [1, 3]. In fact, it can break ivermectin into 10 different chemicals [1, 3, 4]. These chemicals are called metabolites, byproducts of the metabolic process. These metabolites aren't very active in the body, so once ivermectin is converted into them, there's less chance of toxicity.
However, if someone has liver damage, or takes other drugs that are metabolised by cytochrome P450-3A4, ivermectin might not be metabolised as quickly [5]. This can lead to it building up in the blood stream, increasing the chances of toxicity.