There are two main theories for their role
First is that they were more powerful when it came to their military because of their conquering of Sudan and that they conquered Ghana by constantly attacking it an weakening it to the point when they became completely subjugated and under control of the Almoravids. This theory also covers the idea that they spread to neighboring countries as well.
Another is that their power over Ghana was more diplomatic and less militaristic. According to this theory, they married Ghana nobility and spread their religion until Ghana more or less surrendered to them first culturally and then as a country. This idea is supported by lack of evidence of militaristic endeavors since no remains of a rapid destruction were found.