YAML “won” for some definition because it’s really natural to write. Mix colons and brackets, multiline strings that aren’t weird, type annotations when desired, add your own types, basic but functional-ish DRY support that’s transparent to the reader, dict merging. Throw in some value templating a la Ansible and you have a really solid language to express annoying data shapes.
I always saw it as "JSON was the new XML". And JSON Schema was the new XSD. And then they went ahead and also re-invented SOAP using "Swagger" / OpenAPI.
Luckily, JSON/YAML is mostly interchangeable these days as it's just a nested hierarchy of a few basic types. Heck, I mostly treat XML the same way as well.