The cause of endometriosis is not fully understood, but it is believed to be due to a combination of genetic and environmental factors.