The Medici became wealthy merchants at a time when trade was expanding rapidly across Europe and the wider world. This was an age of exploration, and as more of the world became known, opportunities for trade increased accordingly. The Medici were one of many families who took full advantage of these opportunities to make themselves phenomenally rich.
The Medici's political power and influence came largely from their involvement in banking. At that time, European states were often engaged in conflict with one another. Then as now, war was an expensive business, requiring vast sums of money to pay soldiers and buy weapons. That's where the Medici came in. They were able to loan royal houses across Europe substantial sums at generous rates of interest. As well as making them incredibly wealthy, the Medici's banking business gave them an entry into the upper echelons of European political society.
In particular, the Medici's moneylending operations gave them considerable leverage over the papacy. As well as being spiritual head of the Catholic Church, the pope was a temporal ruler, a secular prince with his own territory to defend. Popes, no less than kings, found themselves regularly embroiled in armed conflict, and therefore they needed a steady supply of cash to wage war. This the Medici were only too happy to provide. It was no coincidence that, over the course of a century and a half, no fewer than four members of the Medici clan ascended to the papal throne: Leo X, Clement VII, Pius IV, and Leo XI.