Minecraft wiki entry for playsound, associated text: Specifies the sound to play.
In Bedrock Edition, it must be either a single word (no spaces) or a quoted string. Can be a sound event defined in sound_definitions.json (for example, mob.pig.say).
In Java Edition, must be a resource location. Can be a Sound Event defined in sounds.json (for example, entity.pig.ambient).
A sound event may be affiliated with multiple sounds, and the sound that is actually produced is chosen at random from them, modified by their "weight", just as the game normally would. For example, the entity.pig.ambient sound event plays one of several pig sounds at random, because the event has multiple sounds associated with it.
Resource packs may add their own events to sounds.json; the command successfully plays these. File names are not used by this command; it strictly uses the events defined in sounds.json (which may not even be similar to the original file names and paths), and thus a resource pack adding new sound files must define events for them (this is not necessary when replacing old sounds already defined in events).