I like this question from the Okta community:
Members drift away for all sorts of reasons. They change job, lose interest in the topic, have no problems to solve, don’t get enough value from the community, or didn’t have a good community experience.
Once you know which, it becomes a lot easier to retain the members you do have.