they know because it's all in the big Disney computer in the sky...
and the problem at counter service is that when the CM tries to ring up a counter service meal, the system knows if you have regular or deluxe plan, and will tell her there are no counter service credits if you've used them all up. My understanding of the system is that it cannot automatically convert table to counter service at the cash register, and the CM's at the counter service cannot over-ride the system to get it to take table service credits as payment for counter service meals.
What has been reported is that in advance, take your room cards to the concierge desk at your hotel & ask if they will convert your remaining table service to counter service. People have reported that this was done...but keep in mind it's a straight-across trade, meaning you'll get one counter service for one table service. No extras.