How steam change the world?

I know alot of old cities had steam tunnel where the main way to get heat is from pipes.In the steam tunnel there are pipes for water and steam .That was the way in the old days to get water or steam for heat.

But some buildings had boiler room with a big tank heating water that turns to steam and use the steam for heat.Where did they get the water for the boiler ?

In the old days cars and trains use steam for power !!! How did this work?