You asked how professional developers compile programs for Windows.
Typically, they will buy a Windows computer, or install Windows in a virtual machine (virtual computer). They will use that computer for compiling and testing on Windows, using the relevant Windows tools like Microsoft Visual C++.
Small open-source programmers who don't have Windows and don't want to buy it just for testing can will rely on some volunteer who already has Windows on their computer. If nobody volunteers, then it doesn't get done. That's the nature of open-source: if you want it and nobody else has done it, you have to do it yourself.
It's possible to compile Windows programs on Linux*, so why is it important to have a Windows computer? It's for testing. No matter how hard you try, there's always going to be a chance that for some silly reason your program doesn't work on a real Windows computer, so you need to try it and see. You wouldn't write a Linux program, compile it and give it to someone else without running it for yourself first to make sure it works - and the same applies for Windows.
Every release of a professional product is thoroughly tested on every operating system where it's supposed to work. For free and open source products, the expectations are much lower, and it's quite common for the developer to not make a Windows version at all, or make it someone else's problem - including the possibility of compiling one but not really caring whether it actually works or not. Therefore you may choose not to bother testing every version your program on Windows except when someone complains that it doesn't work, if that's what you want to do. However, I'd say it's a bit pointless to compile one and then not test it even a single time as there's a very high chance it won't work. So you still need to test at least once.
* by installing a Windows compiler on Linux, e.g. see How to compile for Windows on Linux with gcc/g++?. Visual C++ will not work on Linux, but you can use the Windows version of gcc, called MinGW.