To be more clear, let's create a script named showarg:
#!/usr/bin/env bash
printf "%d args:" $#
printf " <%s>" "$@"
echo
Now let's see the differences:
$ var="This is an example"
$ showarg $var
4 args: <This> <is> <an> <example>
$varis split into 4 args.IFSis white space characters and thus word splitting occurred in spaces
$ var="This/is/an/example"
$ showarg $var
1 args: <This/is/an/example>
In above word splitting didn't occur because the
IFScharacters weren't found.
Now let's set IFS=/
$ IFS=/
$ var="This/is/an/example"
$ showarg $var
4 args: <This> <is> <an> <example>
The
$varis splitting into 4 arguments not a single argument.