Every afternoon when your branch closes, all of the cheques paid in over the counter and drawn against other Banks are picked up by a security company and sent on to the Banks main clearing department.
Each Bank has slightly different procedures at this point with what they do with the cheques, but it will include encoding the cheques with the amount using magnetic ink along the bottom of the cheque.
The cheques are then read so that the details are logged by computers and then swapped, so tthat all the Barclays cheques go to Barclays, HSBC to HSBC etc.
Upon receipt of the swapped cheques, the Bank reads the cheques details electronically again and attemptes to debit the funds from the customers account.
If all is well, then thats the end of the process and the funds are remitted to the Bank paid in en-masse. Cheques that are not homoured for payment involve the item being posted to the Bank with a claim for funds to be returned.
It's a really old system that has been utilised for years but the Banks do not have any reason to quicken the process as the volume of cheques being presented daily has been dropping for many years due to other forms of electronic payment such as BACS/CHAPS.
Of course I have simplified the process greatly but at the end of the day, the reason chewues take so long to clear is that is mostly a manual process and the Banks require the actual cheques paid in to be in their possession before a decision on payment is made so that various technical checks can be made. This manual swapping of cheques takes time bearing in mind they are coming from all over the UK.