In my view, JSON beat XML because it matched the way we structure data in code: records and lists. XML, meanwhile, wants us to represent data structures as text with tags, which isn't how we represent data internally at all, requiring laborious translation steps.
The fact that it was "built-in" to Javascript, of course, helped, by allowing it to compete on even footing (XML is also built in via XMLHttpRequest).