The fact that the head of the FBI is an appointee of an elected official, there is some public accountability through voters if there is enough transparency to inform voters of what is going on.
I suppose the same is true for most local police though. As it stands, we don’t get much transparency. For a democracy to work properly, the public needs to be informed. The stonewalling by law enforcement at all levels prevents the public from holding them accountable.