Burning wood and collecting the resulting ashes used to be one of the standard ways of making sodium and potassium hydroxides, aka potash, employed in old fashioned soap making (lye soap made from animal fats and potash if memory serves). Nowadays, I’m pretty sure sodium and potassium hydroxides are obtained from the electrolysis of either sodium chloride (table salt) or else potassium chloride in an electrochemical cell.
Upon reflection, I’m kind of surprised it hasn’t happened more often. Perhaps the usual way of obtaining charcoal from these processes involves some washing and soaking which wasn’t done for a sufficient length of time in this case.