%0, %1 to %9 are "replaceable parameters". %0 is a special one - it expands to the name of the batch file itself.
%1 is the first parameter passed to the batch file from the command line or from another batch, %2 is the second one, and so on up to %9 (the highest possible).
Thus if you type
mybatch.bat cat dog "horse and cart" then in mybatch.bat, when it runs, %1 will expand to cat, %2 will expand to dog, and %3 will expand to "horse and cart"
The parameters can be modified using the same variable modifiers as FOR variables, for full documentation see the FOR help which you get by typing FOR /? at the prompt
They relate to files so that if %1 is a filename then %~d1 is a drive e.g. C: and %~p1 is the path, %~n1 the name, %~x the extension. They can be combined e.g. %~dpnx1
for example %~dp0 contains the drive and path of the batch file itself