First argument of bash is different when parameter is passed or not

scd*_*dmb 2 bash

There are two bash usages:

$ bash -c 'echo $0'
bash

$bash -c 'echo $0' "text"
text
Run Code Online (Sandbox Code Playgroud)

Why in the first case parameter $0 holds the program name but in second the first parameter?

ali*_*nth 9

Per the bash man page:

   -c        If the -c option is present, then commands are read from  the
             first non-option argument command_string.  If there are argu?
             ments after the command_string,  they  are  assigned  to  the
             positional parameters, starting with $0.
Run Code Online (Sandbox Code Playgroud)

And further down:

   If arguments remain after option processing, and neither the -c nor the
   -s option has been supplied, the first argument is assumed  to  be  the
   name  of  a file containing shell commands.  If bash is invoked in this
   fashion, $0 is set to the name of the file, and the positional  parame?
   ters  are set to the remaining arguments.
Run Code Online (Sandbox Code Playgroud)

In short, $0's behaviour varies depending on how bash is invoked.