In time we'll see examples of most of the useful ones. Everything between dollar signs is interpreted by as mathematical symbols and commands. Enclosing math symbols with single dollar signs gives math within a line of text. Notice that the dollar signs around G put it in italic, as is usual for math symbols. More on that later.
Most commands work in only one of 's modes.
Similarly, commands to center text, or to typeset a table or a bibliography, work only in text mode.