The API allows back end access the working of Solidworks. A macro is a series of steps or program that uses the API to perform tasks within Solidworks. This is typically assigned to a keystroke so it can be called as needed. Solidworks allows you to "record" a macro but the end result is really just a program written in basic. However, a macro can be written in a number different languages if VB is not yours style. It can be range from very simple to very complicated invoking set of dialog windows. The API can be used to extend the functionally of Solidworks creating additional built in tools .The API can be called by external applications to have Solidworks perform actions.
To start, there are a lot of YouTube training videos that will help. You should also start by reading the API help file that can be found the the the help menu. I would start with a "recorded macro" that does almost nothing. Then modify it to add the function you would like.
Hope this helps.
Picture the back side of a DVR or TV or stereo. You will find all manner of standard inputs and outputs for connecting to/from other devices. API is the software equivalent, the exposed connections that allow another program to interface with SW.
A macro is a program that connects to the API to control SW.