The phrase means to succeed; to have the ability to do something; to come up to expectations. A similar idiom is ‘be up to snuff.’
The phrase is probably more often used in the negative form, as ‘can’t cut the mustard,’ meaning ‘not able to handle the job.’ An older phrase is ‘to be the mustard’ (c. 1903) meaning ‘to be special’ or ‘to be exactly what is needed’ with ‘mustard’ being a slang term for importance. Why ‘mustard’ was chosen as an example of high quality is unclear. Another phrase, ‘keen as mustard’ (c.1672) means ‘very enthusiastic.’
There seems to be a correlation between the heat and piquancy of mustard and the zest and energy of people’s behavior. ‘Cutting’ has also long been used to mean ‘exhibiting,’ as in the phrase ‘cutting a fine figure.’
The phrase itself emerged in the USA towards the end of the 19th century. The first recorded use of the phrase ‘cut the mustard’ was from the Kansas newspaper The Ottawa Herald, August 1889. A later example is by O. Henry in 1907, in a story called The Heart of the West: “I looked around and found a proposition that exactly cut the mustard.”
One possible source is found in English history. When mustard was one of the main crops in East Anglia, it was cut by hand with scythes, in the same way as corn. The crop could grow up to six feet high and this was very arduous work, requiring extremely sharp tools. When blunt, they ‘would not cut the mustard.’
Another supposed explanation is that the phrase is simply a mistaken version of the military expression ‘cut the muster’. However, the fact that documented examples of ‘cut the mustard’ are known from many years before any for ‘cut the muster’ would appear to rule out the latter as the origin.
A third possibility is in the culinary arts. Mustard is cut (diluted) and made more palatable by the addition of vinegar. Dried mustard paste, which apparently was used to coat meat and then dried to form a crust, which might have been difficult to cut through.
I’m inclined to favor trying to hack through a field of mustard with a scythe. Since I grew up on a farm, that explanation cuts the mustard for me.