It just is: Any valid JSON is valid YAML with the same semantics. It was intentionally designed that way (though not from the start iirc).
Basically take JSON, make quotes optional for strings and make curly brackets optional if the object is indented properly, and boom you've got (something like) YAML.
Basically take JSON, make quotes optional for strings and make curly brackets optional if the object is indented properly, and boom you've got (something like) YAML.