There are many ways to do it, e.g. the former monopolist (a now-privatized company that was created from the part of the government doing it) having a mandate to supply everyone.
The downside of having the government do it is that if the government screws it up, it takes decades to fix, while private companies can swoop in much faster if one company is doing a bad job.
It depends how empowered your regulators are. In many European countries that's how it works and it is literally a better system than the government doing it themselves.