I saw an introduction of -shell-escape here: https://tex.stackexchange.com/a/598819/180617
I know that if I want to use a package like minted or tkz-fct, I have to use pdflatex --shell-escape main to compile main.tex. Because they call pygments or Gnuplot while compiling.
In that introduction, I realized that there exists a restrict shell escape, *latex compiles .tex with this mode.
The default setting is usually "Restricted Shell escape" this allows a small number of programs to be called by default (in a restricted form that does not allow shell redirection) these are (in a default TeX Live 2021 configuration)
bibtex
bibtex8
extractbb
gregorio
kpsewhich
makeindex
repstopdf
r-mpost
texosquery-jre8
My first question is when will pdflatex call something like bibtex or makeindex while compiling? Because in my usage, I'll run bibtex main after pdflatex main, not in pdflatex main.
My second question is when should I use --no-shell-escape?