That comes from the coffee machine built into the galley, which uses the aircraft’s onboard potable water tanks.
Those tanks are filled from a hose by the ground crew during refueling.
(At least for major US airlines. I understand some other carriers serve instant coffee packets. Even then, the hot water still comes from the aircraft tanks.)
Not super comforting if they're then using the same 'non-potable' water to make coffee...
It's presumably boiled, which makes it potable?
[1] https://www.webpronews.com/study-exposes-airline-water-conta... [2] https://www.ncbi.nlm.nih.gov/books/NBK310709/#:~:text=Beside...
It's not.
Yes, there are substances that slip through, but it works well enough for most cases that it's probably fine. Otherwise you get into weird edge cases like "what if there are prions in the water?!?" or whatever.