The county sheriff is responsible for providing public safety to the citizens of a county. This goes way beyond simply arresting the bad guys.
The county attorney is charged with prosecuting crime within the county and serving as counsel to the county in all legal matters.