AMPK (AMP-activated protein kinase) is the body's master metabolic regulator. When AMPK activates, cells take up glucose more efficiently, oxidise stored fat, and reduce energy storage. It's the cellular signal for "use what's available, don't store more."
Both berberine and metformin activate AMPK — that's why they produce broadly equivalent effects on blood glucose, insulin sensitivity, and lipid markers in head-to-head clinical trials. Berberine isn't equivalent to metformin from a regulatory standpoint (metformin is a prescribed medicine; berberine is a food supplement), but the underlying mechanism is shared.
Reference
Yin et al., 2008 — 13-week head-to-head trial: 1,500mg/day berberine vs. 1,500mg/day metformin in newly-diagnosed type-2 diabetics. HbA1c reduction: 2.0% (berberine) vs. 1.9% (metformin). Equivalent.