The Merchant of Venice is believed to have been written between 1596 and 1598, and it likely takes place around then. The play is primarily set in Venice, which was, at the time, an independent city-state, a center of naval trade (in which Antonio engages), and among the only European cities with a significant Jewish population. Despite their numbers, Venetian Jews faced prejudice and persecution, including being barred from engaging in most professions. One of the few ways that Jewish people could make money was by practicing usury: lending out money and charging high interest rates on the loans. Shylock is a usurer and has built his livelihood through the practice; this makes his ultimate fate all the more tragic, as, when Portia (disguised as the lawyer Balthazar) rules against him in court and strips him of his wealth, he states, "you take my life / When you do take the means whereby I live."
Shakespeare often set his plays outside of England, both for entertainment's sake and to avoid punishment for criticizing England and its rulers. These plays were also usually an attempt to get audiences to consider human psychology from a distance. Taking place entirely in Italy, Merchant allowed audiences to consider and critique social and political issues (like religious differences and persecution), but with a certain degree of comfort.