Born on May 3, 1469, he spent almost his entire life in Italy, and most of that time in Florence, his hometown for which he had great affection. He did make brief trips to France, Spain, and Germany as a diplomat. The family into which he was born was not wealthy.
During Machiavelli's lifetime, Italy was not united into a single nation-state. That wouldn't happen until the 1860's. Instead, there were many small, independent kingdoms and republics. They occasionally engaged in war with each other, and sometimes formed coalitions to fight against another similarly-grouped band of monarchies and republics. Machiavelli seems to have longed for the unified nation-state.
He held a variety of political appointments over the years, and languished in the intervals between such offices. He desire to be part of the political process was great, and being outside the process for any length of time was torture to him.
His career prospered when the Borgia family had control in Florence; although Cesare Borgia was known for ruthlessness, Machiavelli seems to have believed that Cesare's tactics were justified, given the dangers posed by Italy's political situation. When the Borgia family was removed from power in Florence in 1512, he lost his position in the city's government, and was later accused of plotting against the Medici family, who'd taken control in the city. Machiavelli did, in fact, oppose Medici rule.
Machiavelli was eventually tolerated by the Medici. He obtained a minor post, allowing him some small participation in the city's affairs. When the Medici were overthrown, Machiavelli hoped to have a role in the new republican government being formed in Florence. But the meager role the Medici had allowed him to hold in the government was enough to make him suspect; the new government denied him a post because of his association with the Medici. He died soon thereafter, on June 21, 1527
The seemingly harsh tone - or, conversely, realistic perspective - of The Prince has made the book controversial over the centuries. Machiavelli's name has become an adjective. The reader must decide whether Machiavelli is truly endorsing what he presents, or merely describing a pragmatic Realpolitik.
In the universe of interpretive possibilities regarding The Prince, four loom large: first, that the text is prescriptive, in the sense that it is instructing the ruler how he can achieve maximum effectivenss; second, that the book descriptive, in the sense that it is reporting how, in fact, effective princes have conducted themselves in office; third, that it is largely ironic, meant to show how repulsive political behavior can be; fourth, that it is designed as a sort advertisement or solicitation to gain the attention and favor of the Medici and win for Machiavelli a position in their government.
Clearly, there are many possible variants and mixtures of the four above-listed interpretations; and there may well be other interpretations at which we have not here hinted. But, in the main, these four cover the majority of tenable understandings of The Prince.