Most of it is down to the "internal market" within the NHS where it's fragmented and run by different trusts. Each trust "wins" contracts based on performance and grant/funding applications. Trusts are given finance for doing specific things, specific treatments, achieving performance targets, etc. So, they won't do anything they don't get paid for or which doesn't help them "hit a target". It just causes conflict between trusts.
So, an A&E dept doesn't want to be seen to having exceptionally long waiting times (as it may affect performance targets, future funding etc), so they deliberately won't accept patients who have to stay outside (or in corridors) under the "care" of the ambulance trust. So that patient languishes in the ambulance trust's waiting time performance target etc. There's no "benefit" to the trust running the A&E to accept the patient handover earlier than they have to. The same principles flow throughout the NHS.
My OH is a classic case. He has cancer and needs chemo for the rest of his life. The oncology dept get funding for his "cancer" related care, i.e. the drugs they give him, etc. His GP surgery continue to get funding for his "normal" care. As a result, when he needs his blood tests (twice monthly), the GP surgery won't do them as they don't get funding for them. He has to go to the hospital who've been contracted by the oncology dept to do their blood tests! When his oncologist flags up that he has some deficiency, rather than prescribing, say, iron, calcium or Vit D tablets, they just tell him to go to the GP surgery, as supplements come out of the GP's funding budget, not the oncology dept's! That costs the NHS a lot more, of course, being OH then needs a GP appointment and a GP blood test before they'll prescribe, say, calcium tablets as they need to do their own consultation and do their own blood tests before they can prescribe! It'd be a hell of a lot cheaper for the oncologist to add Calcium tablets to his monthly bag of drugs they prescribe, but they don't have funding to do it (even though it's minimal). But at the same time, because oncology have "won" funding for OH's long term expensive chemo drugs, there's no benefit to them to stop prescribing the drugs he doesn't need - one of which is a weekly drug costing £2k per pill, they prescibe 3 per month, but he only takes 1 (only needs 1 per oncologist) yet they continue to prescribe all 3 (so £4k wasted every month) because it's easier to continue doing it (as they're allocated the funds anyway) rather than to bother changing the prescription down to just what he actually needs/takes.
This is what happens why you try to impose "real" business-style economics into a state controlled monopoly - it's a complete failure. They thought that it would create competition between trusts, etc to save money, but in reality, it just causes everyone a lot more work, increased admin/management costs, and in a lot of cases causes worse outcomes!