Depends on how many timing loops a track has but it's a matter of simply changing position between each loop on the track - so you could be side-by-side with a car for a lap and nose ahead of each other over the course of the lap and change 'position' several times. Most elsewhere I see 'pass' counters they only tally at the end of the lap but it's also hard to put timing loops around race tracks, especially non-ovals. Some series only ever score at the line even.
That said, given that it's all done electronically the majority of passing comes under pit cycles, where it's very easy for someone to change position a net of 60 times over a cycle...there are a lot of things loop data is good for but passing statistics should be taken with a grain of salt for the most part, or at least taken in context with those other factors. Restarts are also a big inflator of 'passes'.