In more detail
YAML can express everything JSON can (YAML 1.2 is designed as a superset of JSON) and also allows comments, unquoted strings, multi-line text blocks, anchors and aliases for reusing values (&base and *base), and several documents in one file separated by ---. That makes it popular for CI pipelines, Kubernetes, Docker Compose and static-site settings. Indentation must use spaces, never tabs.
Why it matters
A wrong indent changes the meaning silently instead of causing an error. Unquoted values are typed automatically, and parsers that follow the older YAML 1.1 rules, still very common, turn NO, yes and on into booleans and 12:30 into a base-60 number. Quoting strings avoids these surprises. Loading untrusted YAML with a full (unsafe) loader can create arbitrary objects in some languages, so use the safe loader.
Example
A YAML 1.1 parser (Python's PyYAML) reads this file:
country: NO
version: 1.10
time: 12:30
as {'country': False, 'version': 1.1, 'time': 750}. Writing "NO", "1.10" and "12:30" in quotes keeps them as the strings intended.