The MERGE command is new to SQL Server 2008.
The $Action is a MERGE function that tells us what part of the MERGE each row came from.
Note that the OUTPUT can draw from both the source and the master.
The big advantage of the MERGE statement is being able to handle multiple actions in a single pass of the data sets, rather than requiring multiple passes with separate inserts and updates.
A well tuned optimizer could handle this extremely efficiently.
Example MERGE syntax can be found here: