Below is an explanation from bash documentation.
${parameter
${parameter
The word is expanded to produce a pattern just as in pathname
expansion. If the pattern matches the beginning of the value of
parameter, then the result of the expansion is the expanded value
of parameter with the shortest matching pattern (the ``
the longest matching pattern (the ``
, word = */, () , /.
bash-3.2$fspec="/exp/home1/abc.txt"
bash-3.2$echo "${fspec##*/}"
bash-3.2$echo "${fspec#*/}"
bash-3.2$