Jails are run by the local municipal or regional governments and generally speaking only house inmates for sentences of less than a year. San Diego appears to be an outlier with that 6+ year figure.
A prison is run by the state and is geared towards those with much longer sentences.