The usage of these delimiters may vary*, but predominantly they are used to designate optional [..]
and mandatory {..}
arguments. Optional arguments imply that you may omit them without loss of functionality, while mandatory implies that they are required in order to successfully compile your project.
Formerly, the sole use of arguments for different macro parameters meant that users could create, for example,
\newcommand{\mymacro}[9]{%
% Do something with #1, ..., #9
}
without the end user specifically knowing what the meaning of argument #5
is (say). As such, you would constantly have to go back to the documentation and read what goes where what type of argument it is (optional or mandatory). This still happens today. As an example, consider the wrapfig
package's wrapfigure
environment. From the wrapfig
documentation you have

While I love the package, I always have to go back to the documentation to figure out what goes where and why. Other use cases also exist, and if you forget, you have to go back and figure it out. That's just the reality.
If you're uncertain about the type of argument, you could use a quick \show\mymacro
within your document and see the construction of macro. This only works in certain cases, of course, since definitions using \newcommand
with an optional argument doesn't provide much value when using \show
. Here are some examples:

\documentclass{article}
\newcommand{\mymacroA}[2][0]{Do stuff}
\def\mymacroB#1{Do stuff}
\makeatletter
\def\mymacroC{\@ifnextchar[\@mymacroC{\@mymacroC[0]}}
\def\@mymacroC[#1]#2{Do stuff}
\makeatother
\begin{document}
\ttfamily
\meaning\mymacroA \par
\meaning\mymacroB \par
\meaning\mymacroC
\end{document}
In the above example, \mymacroA
and \mymacroC
provide the optional argument/interface, and therefore can by used as \mymacro[<optarg>]{<manarg>}
or just \mymacro{<manarg>}
. It's not that clear from the meaning of the macros that they require it, but they do.
As a matter of instilling good practice, using key-values is always a clean way of passing arguments that could take varied inputs. Using the wrapfig
example above, an interface like the following would, perhaps, be more intuitive:
\begin{wrapfigure}[numlines=12,placement=r,overhang=34pt,width=5cm]
%<figure>
\end{wrapfigure}
where the keys numlines
, placement
, overhang
and width
are have some predefined default.
*The xparse
package provides the means to adjust the type of delimiter quite easily. Moreover, using basic TeX commands, you can also create your own parameter text combinations that could be considered optional or mandatory, using a combination of \@ifnextchar
commands, as in the above MWE.
[]
are optional, and{}
are mandatory :)