A macro is a series of keystrokes, for example, programmed to be executed by a single command. Often used in programs that necessitate long command chains over and over again, that chain is made a macro end executed by a single command.
On the G11 and G15 there is a button that you press to implement macros, and then you save them to one of the "G" keys. Whenever you push that "G" key, the keystrokes you saved are repeated.
When you come across a series of keystrokes you find yourself doing over and over, maybe you'd want to record them in a macro, so you could hit the single key you assigned the macro to and run them. See that macro menu above? One of the items on there is "Record." Get your app to the point you want to have recorded, select that menu, and perform the operation to record. At the end, select Macro, stop in the menu. It will ask you to name it, and certain names will assign the macro to a key. Then next time you're at that point, just call it up by selecting macro, play in the menu, or hitting the assigned shortcut key.
Most Windows apps use Visual basic as the language they record, and you can program them to do more complicated things like conditionals and loops.