When you sign a contract, you make a commitment. A commitment to the client that you will perform specific work and a promise that you will be available to do that work for an agreed upon period of time. Both your client and your recruiter are trusting that you will uphold that contract in the same way that you are depending on them to deliver on their end of the deal.
As with everything in life, though, there are sometimes extenuating circumstances. On the client’s side, funding gets cut or for other reasons completely beyond their control, they are no longer able to continue working with you. On your end, perhaps you get sick or there is a family issue, and you are forced to end the contract before the scheduled end date.
In all cases, the party leaving the contract needs to do so properly in order to preserve the relationships. This video has some tips on how an independent contractor can help soften the blow if they need to leave their assignment suddenly.