Allocating a shard: From where does it come?

When I allocate a (replica) shard to a node, where does the data come from? Does it come from an existing shard in the same zone, or from the primary shard (probably not in the same zone).

Thank you

It comes from the matching primary shard, where ever it lives.