Secret Languages differ among gaming systems and tend to be mechanical, but highly narrative in execution. Let's look at a few.
Thieve's Cant
In D&D, the Thieve's Cant in a slang language that Thieves (Rogues in D&D 5e) learn. Mechanically, it's a manner of communicating with other roguish types. In 1e AD&D, there even was a Thieve's Cant to "English" dictionary produced in the contemporary D&D periodicals. It could be printed (or photocopied!), folded and used at the table. The Thieve's Cant as I recall was more of a slang, much like Cockney is a slang in Great Britain. The dictionary even included some instructions on grammar. Only Thieves could learn the "language."
Alignment Languages
Volumes have been written on this gem in the early editions of D&D. The creators intent of a language that only those of specific moral dispositions, i.e., Alignment, could speak and understand appears to have originated in the ideas of the early Christian church's Liturgical canon that was once only in Latin. Priests performed the Liturgy in Latin and most commoners did not read or speak Latin.
Complicating this mechanical concept was how it worked as written in the rules. If a Lawful Good character should perform an action that the Dungeon Master deemed antithetical to the character's moral disposition, narratively it was possible to force the character to another alignment. Thus a Lawful Good character could become Neutral Good or Chaotic Good (or worse) and this alignment change meant that the character would forget the original language and learn the new one!
This change would create endless debate at the table. Nevermind, that magic was a thing in the worlds most were playing. Call it divine fiat. The necessity to understand why this happened was often distracting.
Battle Tongues, etc.
Like Thieve's Cant, WFRP has a number of secret languages. Mechanically and narratively these often make sense in the world. Take Battle Tongue. it is a slang that soldiers use. Your character could have the skill, but if no one else had reason to possess this slang, then it was effectively useless.
Using theses secret languages must often be discussed early in a campaign and are often house ruled. For example, I would not make Alignment Languages suddenly a forgotten skill, but instead work with the player on narratively explaining the loss of one and the finding of another. Like practicing one language, and lacking practice, begin forgetting on and learning another.