Mounting (aka: humping) is a complicated subject. One we don't fully understand yet.
Researchers and owners have varying thoughts on the subject of humping. Understanding dog culture and body language has yet to be fully realized, our knowledge adapts and changes from year to year.
Some folks think humping represents a dog's sex drive. Some think it is a form of dog play. Others say it is exclusively linked to ranking and dominance. Recent research and observations say mounting is a normal canine response that occurs commonly when dogs, especially adolescents, experience emotional states of arousal.
Mounting behaviors occur for many reasons. First off they're being dogs. Then there can be high the levels of excitement, or perhaps the sexual hormone influences, maybe the dominance behavior, or factor in anxiety and sometimes there's sort of an obsessive/compulsive disorder.
Whether or not we should be concerned is hard to say. This is actually relatively normal behavior, unless it gets so prevalent that you have to consider an obsessive/compulsive or anxiety based cause. In those cases, there are medications that can help such as fluoxetine (Prozac Rx) or clomipramine (Clomicalm Rx). Most of the time medications are not the answer. It is OK to discourage this behavior, (if it doesn't slow down) using distracting commands such as "sit", "here", "down", etc; or by using a head-halter type collar and stopping the behavior each time it starts by controlling your dog with the halter.
Work on preventing humping by teaching a dog skills like sit or down. For example if the dog is going into a state of arousal, they can be cued to stop the behavior and calm themselves down before mounting occurs. With the skills you've taught your dog, you will be giving them something else to do besides mounting. In the event mounting occurs you may need to interfere, but do so very carefully so you do not further arouse the dog or cause the dog to feel threatened.
When mounting is occurring, if you are concerned that one dog is getting annoyed and cannot defend himself or get away from the humper, step between the dogs and separate them with your body. This is only if the dog has not been taught skills with distractions, and is not responding to your cues. If the humping dog cannot calm down on his own and is bothering other dogs, crate him or pull him aside and wait until his arousal level lowers. If the "humper" is not particularly bothering the other dogs - let 'em go for it. Look at it as mother nature's way of giving him an opportunity to practice for sex.
There is evidence that some female dogs exhibit "male" characteristics, such as marking and mounting, which is believed to be associated with higher levels of testosterone. Is this conclusive? Not sure. Maybe the dog learned the behavior from watching other dogs.
Researchers are tossing the whole dominance theory and rank reduction stuff to the wind. The most recent thought is that humping is simply a social behavior/motor pattern that dogs have. All it means is that the dog is excited or in an aroused state. Females do it too. Dogs do not understand rank because they do not relate to the experiences of others. They are self aware but not other aware. They cannot understand "you lose, I win." All they relate to is the present (this feels good) and the past (this was reinforcing and felt good before).
Dogs live in the present, but bring their past experiences along with them to determine how they will respond to present circumstances and situations. What they cannot perceive is the future or how to control or influence the future.
Some portions of this information found on vetinfo.com.