Quoting from Wikipedia:
Lucius Fox is regarded as having the "Midas Touch", an ability to turn failing businesses into successful conglomerates, and is consequently a highly sought-after businessman throughout the corporate world. Fox is called in to the failing Wayne Enterprises and brings a balance to both Bruce Wayne's private and business finances. (The DC Comics Encyclopedia) In Batman Confidential, he is shown heading the project that produced the prototype that would become the Batwing. He also manages the particulars of the Wayne Foundation while Bruce dictates the organization's general policies. Since then, Fox has been approached time and time again by other companies seeking his expertise. After overcoming the original challenge of returning Wayne Enterprises to its former glory, Fox has elected to stay, having been given an unparalleled freedom in the company.
So it sounds like he's simply really good at what he does. The entry goes on to say that "a young Bruce Wayne rescued Lucius Fox from muggers in Paris" which partially explains why he started working for Wayne Enterprises.
As for details, I don't think they've ever been explained. Presumably, it's just like such people in the real world. He has a knack for crunching the data to find what is profitable, what is not, and who can be trusted.