According to Calvinism, why does God give mercy to some and not to others? So according to Calvinism as I understand it...


  ...God has chosen from eternity to extend mercy to those he has chosen and to withhold mercy from those not chosen. Those chosen receive salvation through Christ alone. Those not chosen receive the just wrath that is warranted for their sins against God.


So if everyone is equally deserving of wrath and equally undeserving of grace, why then does God unequally extend mercy to some and not to others?

How does this affect the Calvinist's perspective of the identity of God as being merciful and loving? If the love of God is the motivation for his mercy, what is the motivation for his alleged lack of mercy?
Because he wants to, and certainly not because of anything they've done or will do.

One of the central tenants of this concept for Calvinists is that it's not what you do (or have done, or even will do) that merits you salvation. It is wholly and completely the grace of God, not just that you were chosen, but that you were then called, and then compelled to respond, and then saved and once saved you are secured for eternity.

This article has a much better summary of this concept than I can hope to provide, but I'll provide some selected quotes and summary from it. First from Calvin:


  We shall never be clearly persuaded, as we ought to be that our salvation flows from the wellspring of God’s free mercy until we come to know his eternal election, which illumines God’s grace by this contrast: that he does not indiscriminately adopt all into the hope of salvation but gives to some what he denies to others (Institutes, III.21.1).


In other words, this very concept is something that even Calvinists struggle quite dearly with. How do we deal with a God who gives to some and denies others? 

But the question the Calvinist asks (as the article does). What does God owe us? Eternal Damnation is the proper answer. That he chooses to save any at all is an insane act of love and judgement. The author of this article discusses how the use of the word "denies" can be used to portray God as unjust or unloving. But then he gets to the money quote:


  His point is that none deserve or are owed anything by God except eternal death. No one can claim God as his or her debtor. Therefore, when God “gives to one what he denies” to another, we are to understand that neither deserves eternal life, but in sovereign mercy God grants eternal life to some but not all. Some receive mercy, the others receive justice, but no one is treated unfairly.


Ultimately though, election is not something we can determine other than to know that God calls to himself those that he elects. It's a tool of explanation rather than of determination for those of us here on earth. One more quote from teh same article I've quoted, again from the author:


  In the final analysis, Calvin believes we should study divine election primarily for its ability to tell us why one person who hears the gospel comes to saving faith in Jesus Christ and why another does not. To whom or what, ultimately, do we attribute the distinction? When all is said and done, how do you explain why one person believes unto eternal life and another does not? Who makes one person to differ from another: the person or God? That question can only be answered by looking more closely at the “how” and “why” of God’s sovereign choice. I’ll take that up in the next lesson.


The answer to your question, is, ultimately, we don't know. We do know that God has chosen to call some people and not others and that there is no criteria but the will of God for that selection.