Yesterday for about 30 minutes a group I was in of about 30 defended a tower. There was another group that was separate from our tag, so I have no idea what there results were but this is what we saw:
There is no chance the people running a siege engine came to the tower. There was a separate group attacking and the siege never stopped.
The attackers never got close to the lord, would not have likely even hit a guard though they could have been shot by one.
We generally try to bait/pull attackers to us and make sure that we can all see the tower timer.
Over that 30 minutes some in the raid got 5-6 tower defenses, others got 1-2. We were all fighting the same people, we all got xp for the kills. It had nothing to do with what the attackers were or were not doing, it was just straight up fighting each other.
I agree it's not random, but it is either buggy as hell or there is some hidden metric outside of getting xp during an active timer that we don't know about. I saw on reddit someone mentioned that only people that do a certain amount of damage will get defender.
We do have one guildmate that says the best way to get tower defender is to run an arrow cart. She never missed a timer while running one. I haven't tested that myself yet.