Ok, I'll do my best to break this down for you.
@ECHO OFF
java -Xms4G -Xmx8G -jar minecraft_server.1.15.2.jar --nogui
pause
@echo off
This tells cmd to not parrot commands back to you before running them (the @ turns it off for just this line before the command runs)
java -Xms4G -Xmx8G -jar minecraft_server.1.15.2.jar --nogui
This is where the actual running of the server takes place, invoking java (the program that starts the whole JVM), giving it the options -Xmx and -Xms (the memory setting arguments for max and initial allocation, respectively), -jar (telling it which file to run), and nogui (you should remove the double-hyphen as this one is actually an argument to Minecraft itself rather than the JVM)
Edit: To clarify this further as it's a common issue, -jar needs to be the last of the Java arguments, anything after it is considered an argument to the jar being run.
pause
This one is a cmd command that waits for a keypress before closing, useful for flow control in larger batch files and used here to stop the console closing when the server stops, so in the event of a crash you actually have a chance to see the error until you press a key and it continues to the end of the batch file where the command window will close.
As for your issue, you're starting a vanilla server because you're starting the vanilla jar