The first thing to realize is that the reset associated with \everypar
does not take hold until you leave vertical mode. So to make things easier, let us modify \c
definition to initially leave vertical mode. Everything else stays the same.
The second thing to realize is that each \expandafter
accomplishes exactly nothing (will explain later), so for purposes of understanding the output, they can be ignored.
\documentclass{article}
\begin{document}
\count100 = 0
\count101 = 1
\def\c{\leavevmode%
\the \count100
\advance \count100 by \count101\relax}%
%
\everypar{\count100 = 0\relax}
% the ending dot-brace sequence remembers me the commands executed on each line
\expandafter\c\c\c \hfil $...$
\expandafter{\c\c}\c \hfil $\{..\}.$ % I think it's
% useless for
% this situation
\expandafter\c{\c}\c \hfil $.\{.\}.$
\expandafter\c{\c\c} \hfil $..\{.\}$
\end{document}

With this set, the first invocation of \c
in each paragraph will start with \count100
equal to 0
. In the first case, \c\c\c
, it behaves as expected, with an initial reset to 0
, and an increment of 1 with each invocation.
The second case {\c\c}\c
resets to 0
inside a group, accounting for the initial 01
in the output. However, when the group ends, the reset is confined inside the group, so that the third \c
increments from what was left on the prior line, which was a 2
incrementing to 3
.
The third line \c{\c}\c
has a similar behavior. The count is reset to 0
, it increments to 1
just prior to entering the group. But, upon group exit, it only recalls the pre-group value of 1
, and so the final \c
again prints 1
, before incrementing.
In the last example, the invocations produce a 012
. However, the value of \count100
, upon exiting the group, after the third invocation, is still 1
, which is what the counter was incremented to just before entering the group.
Now let us understand why the \expandafter
accomplishes nothing. Acting upon \c
, it merely substitutes the definition of \c
for the token \c
. However, \the\count100
is still not executed (or even the \leavevmode
). Thus, it has no effect on pre-expanding anything inside of \c
. In some cases, you aren't even expanding \c
, but trying to expand {
, which does nothing.
Finally, let us return to the OP's original case, which omitted the \leavevmode
(\expandafter
is still useless). Now, the count reset associated with \everypar
is not executed until vertical mode is left, which doesn't occur until the initial \the\count100
is encountered in the first invocation of \c
.

So, the first line acts as expected, only because \count100
is initially equal to 0
.
For the 2nd line, the value of \count100
left at the end of the prior paragraph is in force for \the\count100
and then reset to 0. Thus, the 31
of the second line reflects this. But, as before, when the group ends, the final \c
invocation only remembers the 3
from the end of the prior paragraph.
For the 3rd line, the 4
reflects the value at the end of the prior paragraph, which is reset to 0
after the 4
is typeset. Thus, the second \c
produces a 1
. However, the last \c
also produces a 1
, because the increment of the count inside the group is lost in the scope.
Similarly, for the last paragraph, the initial 2
is left over from the end of the prior paragraph, and then the count is reset to 0
. Therefore, the 2nd and 3rd invocations yield a 12
.
If I understood what it was you were trying to accomplish with the \expandafter
s, I might be able to help, but it is not clear to me what you are hoping to have happen.