Consider the following Vim ex command,
:let i=1 | \'<,\'>g/^/ s/^\\ *-/\\=i/ | let i+=1
It replaces the heading dash with ordered number
This is the general pattern of a :global command:
:global
:g/foo/command
Because everything after the second separator is considered as one command, the counter is incremented each time the command is executed: one time for each matching line.