Specialists choose a pipe organ of their choice (usually of a true historical value). They come and record with a special equipment every single pipe of every single stop on that organ. The pipes of the compound stops, such as mixtures or cornets have to be recorded all together, of course.
Besides recording the separate pipe sounds they also record the acoustical environment of that space along with the temperament of that organ, of course.
This process takes many hours to complete because they record everything one by one. Pipes of individual stops which are not in tune can be adjusted later on the computer. The compound stops have to be in tune during the recording session itself.
Then they process everything digitally and create a sample organ which can be played on any keyboard where is MIDI: synthesizer keyboards, electronic organs, even on pipe organs with MIDI capabilities.
The virtual organ program requires a computer with a connection to a MIDI keyboard (or several keyboards and a pedalboard). So from a comfort of your home you can produce sounds, similar to your target model pipe organ.
Registration changes are done with the mouse on the computer. The sound, of course, depends on your speakers.
You can go one step further and even have 360 degrees picture of the cathedral or a church on the computer where the actual organ is located. It's kind of fun.
However, the actual feel and touch of the keyboards will not be the same as on these pipe organs (in most cases anyway). That's one areas were real mechanical action organs are unique.
By the way, do you want to learn my special powerful techniques which help me to master any piece of organ music up to 10 times faster? If so, download my video Organ Practice Guide.