The most common theme you're likely to see in a rejection of your manuscript is, "this just isn't for me" or "I didn't fall in love with it." The big question you're left with is, is it your manuscript or the agent's preference? If you have revised and polished your manuscript and have had either beta readers or a critique group read it and give feedback, then it truly might just be that it isn't what the agent is looking for.
"But wait, how can this be?" You ask. "I researched the agent thoroughly and it says on their website, blog, or Twitter feed that they're looking for my type of novel." You say. I trust that you did and will have a glass of wine with you to help take the sting out.
Unfortunately there is more to finding the right agent than writing a good book and identifying an agent who is looking for your type of novel. I know, I know, please don't throw things at me. The industry is still in turmoil and no one knows what it will look like when the tornados of change are done with it. Agents and publishers are both apprehensive and run business with extreme caution. Your idea must be outstanding, your writing must be outstanding, your timing must be outstanding, it doesn’t hurt if your online presence is outstanding, and last and most important, your luck must be outstanding. Ah go ahead and throw things, I don’t blame you. In fact I'll join you. I didn’t need that paper weight anyway.
There are agents out there (so I hear) that are willing to take you on and help you polish your work. However, that falls under the outstanding luck and to get that you still have to have an outstanding idea, writing, and timing. To obtain those things all we can do is write, revise, get feedback, and repeat. When is it polished enough? When do you stop? I wish I had the answer. This industry is pushing us writers to either excellence or madness, I haven't decided which yet. When it seems as though you're ready for the straight jacket (I've been pre-fitted for mine) remember that the industry isn't necessarily changing for the worse and you have options.