Are you referring to the learn guide demonstrating the policy JSON reference in the aws_s3_bucket.policy vs the provider documentation demonstrating the reference inside an aws_iam_policy.policy?
Also, like, most of their examples ignore this data resource. That specific data resource, with terraform 0.12 makes building IAMs so much nicer, because you can mash a bunch of common ones together with for_each and generate policies in a dynamic way without having to learn dynamic IAM stuff, which is it's own thing entirely.