And to keep a happy staff...
You need to have some worthwhile things for them to do (worthwhile in customers' and each worker's view, not just the CEO's).
You need to have mutual respect.
You need to have a meritocratic reward system and minimize "office politics" (which are inevitable, but the more the best way to deal with them is by pointedly ignoring them the better).
But that also means you have to have viable ethical products; otherwise most of the workers won't be keeping up with the cost of living, let along getting ahead in their careers and lives. And if what you're doing or your products are aimed at unethical uses, then you'd all better escape the sinking ship as rapidly as possible.
You need to be open so that everyone has realistic expectations, etc.
And for most people, it requires a bit of fun and creativity, creative fun... to be able to keep on coming up with those great new products, features, and solutions to mysterious problems.