Your SQL code selects all the variables from A. The only reason for using any data from B is to compare the IDs and select the matches.
Your MERGE on the other hand, takes on data from both data sets. Where there is a match on ID, NAME from B replaces NAME from A as the final value.
... View more