Does the department determine it, or does the president determine tenure after the department recommends it? Or does the process go through both ways?
And how does this vary from institution to institution?
The process varies from place to place but in most places the technical determination is made by the department and to some extent the college. Higher levels of approval focus mostly on whether proper procedures have been followed.
Having said that, when things go wrong they could go wrong at any level. Usually it's politics that derails cases at the higher levels rather than straight technical merits.