Confused about interaction between unique count and buckets

Yeah, I'm not sure why there's this discrepancy. I'm moving this post to the Elasticsearch category hoping someone there can explain what's going on here.