You'd use an omni when you need to pick up sounds from all around, specifically at the soundhole, in the interior of an instrument, or at the bridge. A cardioid microphone picks up better in the direction to which it is pointed. It tends to reject sounds that come from its rear and reduces the level of sounds that comes from its sides. When you have a feedback problem, a cardioid can help. Cardioids tend to have poorer bass response than omnidirectionals.
Cardioids also are much more susceptible to wind noise.
You'd typically use a cardioid mic outside the instrument from some distance. They are electrically and mechanically modified so as to record extremely loud sounds with very low distortion, and to eliminate mechanical resonances in their bass response. Before Core Sound's modifications, the Matsushita cartridge's frequency response is specified flat within 1 dB from less than 40 Hertz to more than 15 kiloHertz. We match the pair to within one dB of each other. The microphones are nominally omnidirectional but their pickup pattern is modified by the absorption and reflection characteristics of surfaces close by.