Martial arts sects in ancient China: Shao lin, Wudang (Wudang was formed from an ex Shao Lin disciple; though Wudang’s form of martial arts and philosophy is inclined towards Taoism), Emei, Kunlun, etc. Understandably, some of these sects were either of Taoist or Buddhist-affiliated origins.
China is a very huge nation and in ancient times, some temples were in isolated, secluded mountainous regions and were often raided by bandits, etc. Hence, there was a need for the monks to take up martial arts to defend the temple and themselves from such raids.