They were created because then British Rail had a large shortage of trains so rather than spending lots of money on expensive proper trains, they invented the Pacer. British Leyland at the time had a surplus in the production of bus bodies so the idea was to weld the bus body from an old bus on to a freight waggon chassis. The result of this was that pacers have notoriously poor suspension and are noisier around corners due to flanging (the squeaky noise that you'll sometimes hear when travelling by train). This makes them non-ideal passenger trains so they are now being replaced (or have been replaced in the case of the class 141) by new trains.