It’s when the lead off batter comes up for the second time in an inning. Even if a pitch isn’t thrown to him (ie a pickoff). I read on deadspin that an early version of the game allowed all to bat in an inning. If the last batter hit a home run, the lead off would be allowed to bat again. It was termed “batting around”.
I see that many interpret it as 9 batters, including many experts. But I can’t say I understand why they would think that.
I'm thinking even the people that say it don't really believe it. It seems to make sense abstractly, but would they say, when the eighth batter gets on, or even retires with two outs, "Now they've batted around," just because the end of the lineup is coming up? Makes no sense.