The W3C Events Specification defines how events work. Events are dispatched on event targets, the resulting Event object has an associated target property that is the element on which the event was originally dispatched (e.g. an element that has been clicked on).
The event bubbles up the DOM and any element it comes across that has a listener for that event is called by its handler. The related event object is augmented with a currentTarget property that references the element that called the listener.
Note that not all browsers in use fully support all the above features, in particular the currentTarget property is fairly new and older IE supports event.srcElement rather than event.target
You should read the specification linked above, the MDN Event reference and related articles.