Most commonly, it comes from the mains drinking water connections.
There are a number of other technologies which use grey water or rain water to flush toilet cisterns but these are considerably more expensive, require additional plumbing infrastructure and also use electricity to pump water around a building.