The most obvious route is through consumption by humans and animals, prescribed by medical professionals or veterinarians. When taken, only a certain amount of any dose is metabolised, so the rest passes into the sewage system (or in the case of animals, into groundwater and eventually into the leachate.)
Regular wastewater treatment plants (WWTPs) are not designed to remove APIs, so over the last 80-odd years, their concentrations have been building up in what we used to refer to as ‘clean’ water.
Worldwide, the problem has got worse in the last 20-30 years with a growth in the use of antibiotics in countries with a less regulated approach to medicines, especially when the manufacturers’ recommended dosage and course length may not have been followed.