It's usually a company owned by the city or the state, e.g. https://en.wikipedia.org/wiki/Berliner_Verkehrsbetriebe