How do the sports commentators know the level of the step sequence without knowing the judges' scores?
They will often say what is on the planned program sheet. So if the skater plans on doing a level 4, they will call it that, and it may or may not actually be called that by the tech. panel.
The other explanation is that many competitions, especially in the United States, are not broadcast live. The commentators record after the protocols are available, so they are able to say what the judges did, but they keep the illusion for the viewer that they don't know what happened (I've seen a few competitions with slip ups where they clearly mention something that hasn't happened yet, in terms of the broadcast, like 'ooh, this SP flip will get downgraded, but in her long program she gets positive GOE).