How does P2P lending work in India?

Recently i was reading an article where BharatPe offered it’s partners i.e., shop owners the ability to save money with BharatPe and earn an interest of 12% p.a. but little did the shop keepers know that their money was lent to other shop owners in need of money for 24% p.a. interest. Is this legal?

They had tied up with https://www.liquiloans.com/ for this agreement