Mechanism of the insulator-to-metal transition and superconductivity in the spin liquid candidate NaYbSe2 under pressure