according to explanations found on the internet, this expression comes from the comparison between buttocks and onion, which are (supposedly) seen as having the same shape...Then came the easy association between onions and shallots... Today, "mener une course à l'échalote" is used to describe people trying to reach the same goal, as quikly as possible, and by all means. It has generally a pejorative sense, and more particularly in the sense of a kind of "immature" behaviour. I don't know if I'm really clear, but for example politics, during an electoral campain are often described as "menant une course à l'échalote".
Hope it helps (at least a little)
(Several years later) Thanks! I found this thread while looking for the expression here with a different verb (from an article in Le Monde about F. Hollande's visit to Cuba): "Il serait absurde d'entamer une course à l'échalote avec les Etats-Unis ...Nous avons notre politique dans les Caraïbes." So maybe "to try to outdo the United States"? (Don't want to be too vulgar...or "cheeky"!)