A contract is assigned when one of the parties transfers their rights and obligations under the contract to another. For the assignment of a contract to be effective however the other party to the contract must be informed and agree.
Contracts are usually assigned in the context of one business taking over another. Thus if Business A takes over Business B, they will wish to acquire all the contracts and customers of the business they are acquiring. Under UK Law however it is only possible to transfer the benefits and not the obligations of a transfer. Thus Business A can become entitled to receive all monies due to Business B from their customers without any obligation to provide the services to the customers. Conversely, they could receive the right to receive goods and services due to Business B without any obligation to pay for them.
For this reason, most business contracts contain a prohibition against assignment without the express permission of the other party. This will allow the assignor to ensure that the assignment contains a clause requiring the assignee to carry out the obligations under the contract as well as receiving the benefits. An indemnity against failure to do so will usually be included.
Sometimes a party to a contract will not wish to assign their rights under a contract but get someone to carry out their obligations for them. This can be prevented in contracts for personal services by including a clause prohibiting assignment. If I agree with a certain window cleaner who does a great job in cleaning my windows, I might well wish to include a term in our agreement that he does not assign the work to anyone else.