(Action-)Descriptor is just the name for an object that describes (hence the name) a certain event/operation that happened in Photoshop, including all necessary parameters and the target which will handle the operation (layer, channel, etc).
If you register an event listener for specific events (in this case the
select event), Photoshop will call the handler function that you pass as a parameter, everytime a
select event occurs. But
select is not unique to just selecting a document, it will also fire when a layer or a channel gets selected.
That’s why you should check if the descriptor is targeted at an object of the document class. (You get the descriptor returned by the event as a parameter in your event handler, as described in this thread).
But as Jarda pointed out,
select isn’t the only event altering the active document. That’s why I personally use the
layersFiltered event, which seems to happen on every change to the active document (select, open, close, etc.)