How it really works is actually up to the "Binding Handler", of which there are many built in, but you can also make your own. It's not quite publish/subscribe though...
If your look at the "value" handler...
it's quite complex, since it has to deal with browser anomalies etc., but in general it just comes down to two methods in a handler.
"init"
Set up the event handlers you need (the soon-to-be bound element is given as the first argument), and what should happen when they fire.
"update"
Define what should happen if an observable, bound via the binding handler, is modified. Usually it should do something with the element, such as setting its field value.
The documentation on custom bindings may be what you need.
/G