The Windows debugging API always injects a breakpoint exception as soon as a debugger is attached. This pauses the debugged application and gives the debugger a chance to access the application and do any initialization it needs to.
From the DebugActiveProcess documentation:
The system arranges for the first thread in the process to execute a breakpoint instruction after it resumes. Continuing this thread causes it to return to doing the same thing as before the debugger is attached.