This is a more complex answer than the question asked since it depends on many factors such as; type of lithology, mineral content, objectives of drilling, whether coring is required (and the major objectives of the coring), etc.
For instance, as a simple coring case, if the objective is to obtain water saturation (e.g. from Dean-Stark extraction) then it is best to use an oil-based mud with as little water content as possible but if there is water content, this must be "traced" (or doped) with a chemical to distinguish between formation water and mud filtrate water (various different chemical tracers are available).
As Mr. J. Reed mentioned this is a very complex question but the reality for the selection of the required chemicals is based on two major aspects: Functions that the fluid must do i.e. cuttings transport, density required based on pore pressure, then cooling effects, friction and so on, there are many more including the type of operations, lithology and etc. The second aspect is this of how practical it is in terms of supplier, environmental regulations, cost and track record of the fluid and chemicals. Whether it is one surfactant versus another is almost irrelevant to the drilling engineer but important to the supplier and they will be guided by their product range and their commercial interest. Something very similar applies to completion and cementing fluids. I hope it helps