Andy gives Barney the job of making sure an escaped convict doesn't come into town on a side road. Barney takes his job a little too seriously and frisks every person who drives by.
Barney quits his job as detective because Opie wrote a nasty poem about how there are no crimes for Barney to solve. While Andy tries to reassure him that he is an important member of the team, Opie explains what happened.