Volcanic eruptions spew lava, rock and ash into the air. When fragments of these materials mix and collide in the outflow, they can create an electric potential large enough to generate lightning.
source https://phys.org/news/2021-09-outflow-gases-volcano-lightning.html