After the second millenium, Jainism and Buddhism faded away. Islam arrived before the area was conquered by the Islamic Moghuls, and gained in importance under their rule. Many left when Pakistan was created.