to enforce local laws.
county sheriff's are there to enforce county laws, as well as run the county jails when necessary.
state troopers are only supposed to patrol our state highways. state paid traffic cops.
they don't have a residential beat, they don't have civil paperwork to deliver, they don't have a county jail to maintain, they just patrol highways.
in other states, the county deputies do a lot of patrolling of the highways, as the counties want to get a piece of the 'ticket bonanza'. if the county deputy writes the ticket, the county gets all the funds, except what the state charges. if the trooper writes the ticket, the county only gets a little.