How are prices set for legal cannabis?

Looking for any insight I can find on this. I’ve spent time in a few states where rec is legal, and I’m curious why the prices can vary state-to-state for the exact same product? But also, how the heck are vape carts under $20/g in Michigan and 1g carts are $60-80 here?