There are a good deal of teaching points in this small event, one of which was the Jews were illegally trying a person of a crime (both participants had to be there). Another was a trap to see if Jesus would uphold the law and put Him in a contradiction of Roman law since only Rome could mete out capital punishment (adultery was punishable by stoning), then He would be an enemy of Rome as well as of the Pharisees.
Probably they had all barged in on the couple, distorting the intent.
She may not have even been guilty of what they accused her of. It may have been a set up from the beginning. Something to ponder...
Maybe that’s how tradition had it — I won’t argue. I’m going by the bible. Leviticus requires that both be punished. Deuteronomy requires that two or three witnesses accuse. Jesus would observe the scripture, not the tradition.