I always thought outside of detective all promotions were civil service tests.
For SCPD, municipalities (towns, villages, etc)
Promotions by ranks are either civil service exams
Sgt, Lt, Cpt,
Promotions to senior and speciality positions are by appointment/Selection, etc
Commissioner's, Chief's, Deputy's, ESM, Air, COPE
To become a PO, is also a civil service exam
For Suffolk County Sheriff's it's an elected position, and the Deputy's are through civil service exam and promotion exams and appointments, by the Sheriff.
In general, a sheriff has more clout than a police officer. With that being said, they don't “outrank” them since a police officer isn't in a sheriff's chain of command. A Sheriff is generally (but not always) the highest, usually elected, law-enforcement officer of a county, whose allegiance is generally to the citizens of the jurisdiction that elected him. Chiefs of Police usually are municipal employees who owe their allegiance to a city or the elected 'executive' that appointed him, not to the citizens of the jurisdiction that they work in. This is usually why Sheriff's are perceived to be better overall with regards to law enforcement, they are actually accountable to their jurisdiction through the election process. Also notable is that PA also has elected Constables (which operates similar to Sheriff's, with additional voting location security and bail enforcement actions)