@penguin42 @gigabecquerel good question! let me see...
...well, this paper (https://www.sciencedirect.com/science/article/pii/S2666893922000366) has the following passage, which seems like a decent summary of the speculation about the mechanism for formation from saccharides specifically:
Although synthesis of CDs from carbohydrates has been extensively studied, synthetic pathway of CDs remains unclear, because there exist diverse intermediates and it is practically difficult to identify all of them (Xu et al., 2014). One plausible mechanism is that the synthetic pathway of CDs begins by the hydrolysis of starch in aqueous phosphoric acid solution. Phosphoric acid was proposed to act as a chemical agent of polysaccharide (Xu et al., 2014). In fact, starch is converted to glucose by hydrolysis in the presence of H+ under hydrothermal condition (Nagamori & Funazukuri, 2004). Although the major product of hydrolysis is glucose, a variety of saccharides including maltose and fructose are also produced (Nagamori & Funazukuri, 2004). Glucose and other saccharides undergo degradation reaction by dehydration, forming furfural intermediates (Titirici & Antonietti, 2010). It is possible that the furfural intermediates are polymerized, and changed to aromatic polymers, which finally condenses to a carbon-like material (Titirici & Antonietti, 2010; Xu et al., 2014). Moreover, hydrogen atoms in glucose may react with hydroxyl groups of other glucose, and formyl groups may react with hydroxyl groups (Bayat & Saievar-Iranizad, 2017). This dehydration of glucose molecules has been proposed as another possible route to condensed carbon-like materials (Bayat & Saievar-Iranizad, 2017; Sun & Li, 2004). Carbon atoms in condensed substances may undergo aromatization to form polymers with aromatic rings under hydrothermal condition (Sun & Li, 2004). Nucleation and growth of aromatic polymers are expected to subsequently occur via cross-linking and cycloaddition reactions of polymers (De & Karak, 2013; Sun & Li, 2004). The resulting carbonized nuclei which are soluble to aqueous solvent become CDs.