It depends on what the first database is.
If it is a remote CouchDB, pouch makes an xhr
request to the db/_changes
resource for that couchdb (http://wiki.apache.org/couchdb/HTTP_database_API#Changes). It does indeed set feed=longpoll, as Kim mentioned. The longpoll
option makes couch wait until there is a change before it sends anything- this way you don't poll over an over only to find there were no changes.
If the first database is a local PouchDB, it listens for "change" events, which are triggered whenever a change is made in the database.
Either way, when the replicator sees a change come in, it replicates it to the second database.