Harzel
Adventurer
At best, I would say the rules typically state when the player is not privy to certain information regarding a class ability modifying or interacting with another feature.
I think that I don't understand what you mean by the bolded phrase because a) outside of this context, I never would have imagined that that phrase covered knowing what spell an NPC is casting; and b) I cannot think of any rules that make a statement such as you have described. Perhaps citing one or two examples of such rules would clarify it for me.
Otherwise, it generally assumes the player knows the relevant information. Not RAW, but consistent with established design within 5e, IMO, YMMV, etc.
The way you say this implies that there is a clear definition of relevant information that a) is reasonably bounded and b) should be obvious to everyone. To me, this seems clearly untrue. Which spell an NPC is casting is clearly relevant to the potential counterspeller. But so it the level at which the spell is being cast. So is the number and level of spell slots that the NPC has left. So is what spell(s) the NPC is intending to cast next round. So is what spell(s) other NPC casters (if any) are preparing to cast. Etc. I see no obvious reasonable bounds to what information is relevant.
Furthermore, the situation is not some unique oddity of casting counterspell. It is quite common that when a character uses a limited resource, there is a multitude of information that they do not have, which, if they had it, would allow them to use the resource more efficiently.
None of that is to say that it is not ok to decide that characters (or maybe just casters or maybe just casters who know counterspell) always know what spell an opponent is casting. And it's fine* for the reason to be that, in your judgement, that information is necessary to make counterspell useful/fun/effective/whatever. I just disagree with casting that decision as the application of an objectively-rooted general principle.
For myself, deciding how to adjudicate what characters know is a bit of a dance between how I imagine the world should work, and how I think the game should play. (Both of which one can reason about to some extent, but are in the end subjective.) In general, that characters would always or never know what spell another character was casting both clash with how I imagine the world working, and I don't like how either of those extremes affect how counterspell plays - 'always' making it a bit too useful, and 'never' leaving it a bit too chancy. So that leaves the middle ground - uncertainty** - which, fortuitously, seems ok to me both in terms how the world works and how counterspell plays.
* And, no, I'm not implying that you need my blessing to do this. In this context, "it's fine" is shorthand for "I am not claiming that I have proved that it is unreasonable".

** Though in particular circumstances there could be success or perhaps even failure without a roll.