My guess is some kind of code inside JSONDecoder already has a representation of the kind, somewhere. Maybe it's a transient value, but it has to go from bytes to string to json type (dictionary or array, number or string), then to custom struct type. I don't see how it would be able to parse a json stream otherwise.
And my guess is also that this should be performant. Now maybe it's all C inside, i don't know, but then maybe this would be a good opportunity to redevelop JsonDecoder entirely in swift from bytes to struct.