Why does a hydride like NaH act as a base, but a hydride like NaBH4 act as a nucleophile?
First of all, borohydride as a group is not same as hydride. So the mechanisms are very different.

Because a simple $\ce{H-}$ anion is more basic than an enolate $\ce{C=C-O^{-}}$(product of $\alpha$ hydrogen deprotonation of a ketone), it just deprotonate before reduction will happen. Deprotonated ketones (enolates) will no longer be a substrate for reduction.

Borohydride $\ce{BH4-}$ is not as basic as enolate, so deprotonation hardly happen. Thus a reduction will be the predominant reaction.