What causes melanoma? I know too much sun causes melanoma, but what could cause it on skin that’s never exposed to sun?

Unknown. Apart from sun (uv light), it's not entirely clear what causes melanoma. Mutations in many genes have been discovered such as braf, nras, and c-kit but much more research needs to be done.
Cell division. All dividing cells have the potential to have an error of division leading to cancer. Sun damages the skin cells increasing the rate of cellular division and therefore increasing the chance of an error causing cancer. So a few melanomas will occur even though no light exposure has occurred. Excellent example: melanoma of the meningeal lining of the brain - no light exposure there.