It’s done by grinding lower grad pot into a fine powder and then dripping alcohol through it to extract the essential oils. This is usually done in a sealed low temperature distillation setup.
The danger comes when people try to rush the process and increase the heat to the ignition level of the alcohol.
Don’t ask how I know this.