It works roughly like this: Patient number #xxx, diagnosed today. Last Monday, he used a taxi (11:30-12:00) to visit McDonalds next to Hongdae station (12:00-12:50) and then walked to Woori bank nearby (1:30-2:00) and used another taxi to go home. Next Tuesday... blah blah...
And then you find out the taxi drivers, all the McDonalds workers, and everybody who used McDonalds and the bank at the same time, and tell them to go self-quarantine for two weeks. And also test them. The idea is basically catch all the virus before it has a chance to run into more people.
It does help that Koreans carry cell phones and use credit cards everywhere. (And, yes it does raise the question about privacy - which is something we should revisit once the emergency is over.)