This saying comes from approximately 1648 when Cromwell sent some Royalist soldiers to be imprisoned in the town of Coventry. The local parliamentary supporters shunned them.
In Stalag IV-B, the British used this same form of shunning to punish a prisoner who had disobeyed rules, such as stealing from other prisoners. It proved very effective. To be further isolated without communication from your fellow prisoners served the person of enforcing discipline.