"No win, no fee" is actually funded by an insurance policy, not a loan.
In the event they win your case for you, they claim their costs from the losing party. If they lose, they claim for their costs against the insurance policy. This is why it is so important to them to only take on cases...