You are right, it's a piezo-electric device. Knock creates voltage, ECM sees that, retards timing a set amount. (set by the PROM) The ECM knock test I am familiar with (could be different depending on ECM) is that the ECM initially advances timing past the point where GM has determined knock will occur under a set condition (making up numbers, feed say 30* advance at idle 90 seconds after startup) and if the ECM gets the feedback from the sensor saying knock occurred, then the sensor passes the test. If knock has theoretically been induced, and there is no feedback, the sensor has failed the test.
Many people don't understand that "maximum spark advance" is not the goal in an engine, and the EFI systems do not attempt to run as much advance as possible. The advance is a carefully (that's up in the air) calculated curve in the PROM, and the knock sensor is there to make sure that IF something does go wrong (bad fuel, hot, etc) the engine doesn't detonate itself to destruction.
As clarification, some systems use a standalone module (MAF TPI is one, I assume TBI is as well) that handles timing/knock (ESC) but still gets its info from the ECM. Later on the knock capabilities were integrated with the ECM, so there are no standalone modules. MAP TPI is an example of this, and I guess yet another "advantage" over MAF. The knock sensor is just that, a sensor. It does nothing other than sense knock. The ESC components and ECM are what do the actual timing/retarding work based on the sensors output.