The thin blue line comes from the thin red line, where a line of British redcoats held back a heavy cavalry charge in the crimean war. I've always taken it to mean that police officers consider themselves soldiers holding the last line of defence against wild enemies. Which is itself a controversial and probably unhelpful way to think about your job as a police officer.