I've noticed, people quit at brown or purple belt
Cause #1. They feel they've learned enough. Solution: Show them there is so much more to learn and accomplish: Techniques, tactics, weapons, speed, bunkai, history, etc.
Cause #2. It's getting too hard for them as they don't have what it takes to persevere and overcome the challenges. Solution: Have them get over their ego and stress the work it takes to advance pays off in dividends throughout their lives. Encouragement and recognition of effort but not patronizing.
Cause #3. Financial or time restrictions. Solution: Work it out on a one-by-one basis.
what's your take on how to retain members at a martial arts club?
The word "club" may be frowned upon by some, but in a sense it's key. Maybe "fraternity" would be a better word. Despite being a place to learn how to inflict injury, it should be a "safe space" where one can go and be accepted as a fellow student, regardless of their background. There was camaraderie. Like a fraternity, long lasting bonds could be forged.
As a teen, the dojo was my "hang out" and I spent time there outside of classes, especially during vacations. There I could practice on my own, get tips from Sensei and senior students who also dropped by, or just BS'ing around, sharing life knowledge and experiences. A sense of "belonging" to the dojo rather than just a place to sweat for an hour, then leave behind after class was over. Two or three social events per year can be helpful in team building.
Develop a central core of motivated, dedicated students. This small number can provide the current that carries many of the other students along.
Simply put, a sense of loyalty to the dojo and sensei. This was very true of pre-commercialized schools where the sensei was not just a teacher, but a life coach. All the above can still be true today by a good sensei who sees students as something other than revenue. Loyalty works both ways.
Lots of colored belts, games, variety in drills, special rates for continuing, etc. are all used to foster retention, but IMO, pale compared to what I've described. I will admit this is a rare thing, but I believe the true answer to your question. In a word: HEART.
(Could be I'm just living in the past, but wouldn't it be nice.......?)