Whats the main cause for a miscarriage?

❤❤🙌🙌

I miscarried and my doctor told me the sperm didnt set right with the egg causing the baby to not develop like supposed to, but he didnt know for sure he just said thats normally what happens. any one else?