GO is a batch separator or terminator, it is not a T-SQL Statement or SQL keyword, that’s why it must be written in new line.
As you can see that when we execute left side window. DROP statement consider as part of the stored procedure. So stored procedure will be created and on first execution of that stored procedure that will be drop as stored procedure itself contain drop statement within it.
While on right side window, we placed a batch separator GO which separates that code in two batches:
Using SQL server Management Studio, Tools -> Click on Options… and Select the Query Execution Tab.