Its probably not the actual location of the tube, but a guestimate based on the departure time, arrival time and the distance between stations.
On older lines, they can only detect when a tube changes power circuit and the resulting blue/white spark sends a measurable pulse down the power system. In this case, yes, they have to just count trains into and out of a section.
I learnt this by chatting to a TFL engineer in a pub, he designed the signalling systems equipment.