That's essentially what it is. When a player leashes an animal, that player's entity is attached to it. When a player attaches it to a fence post, a LeashEntity is spawned on the fence so the animal can attach to it.