Looking back from the high hill of his 50 years of public service, Leon Panetta has written a memoir that contains thoughtful insights on the art of governing and the importance of compromise. During the first term of President Barack Obama, when Panetta served in two top Cabinet posts, he led the inter-agency effort to locate Osama bin Laden and oversaw the winding down of two wars. He leaves behind a legacy of accomplishment and a book that provides valuable lessons for the next generation of leaders.

In explaining the man he became, Panetta starts with his origins in Monterey, Calif. He tells of his father’s 1921 emigration from Italy, his early struggles in the United States and the restaurant he built with his mother in Monterey. Rich in detail, this portion of the book shows a different side to the “Cannery Row” made famous by John Steinbeck.

As a student and budding lawyer, Panetta was a Republican who admired President Dwight Eisenhower, fiscally conservative but a centrist on social issues. Fresh from a stint as a First Lieutenant in Army Military Intelligence, he joined the staff of U.S. Sen. Thomas Kuchel, a moderate California Republican in the Earl Warren mold. Panetta reveres the memory of Kuchel, “who was principled without being particularly ideological, forceful without being doctrinaire.” As Panetta embarked on his own career in public service, he adopted this realist approach.

Following his tenure with Kuchel, Panetta was hired in 1969 by President Richard Nixon to be the director of the Office of Civil Rights in the U.S. Department of Health, Education and Welfare. As explained by the author, however, his enforcement efforts in the Deep South outraged Dixiecrats who had supported Nixon’s 1968 election in exchange for certain “assurances” on civil rights. Under White House pressure, Panetta resigned in 1970.

Panetta went to New York City, where he served as an executive assistant for Mayor John Lindsay. Panetta states that Lindsay was charismatic and charming, but possessed a tin ear when it came to local politics. In one amusing passage, Panetta recalls that during the sanitation workers strike, “Lindsay sent me out to talk with them on the theory that they might listen to an Italian. They didn’t.”

Panetta quit his post with Lindsay in 1971 and returned to Monterey, where he practiced law with his brother and became a Democrat. In 1976, he was elected to the U.S. House of Representatives. He recalls that his tenure as a newly-minted congressman got off to a rocky start in 1977 when Speaker Tip O’Neill leaned on him to vote in favor of a pay raise. Defying the Speaker, Panetta voted against the raise, which passed anyway, and then he refused to accept the increase by sending a refund check each month to the Treasury. Those refund checks became a staple in each of his eight subsequent re-election campaigns, building trust with the electorate.

Panetta rose to the chair of the House Budget Committee while championing antipoverty programs and protecting the Monterey/Big Sur coastline. One of the best parts of the book is Panetta’s recollection of the 1990 Budget Summit, in which President George H.W. Bush and Congress negotiated a difficult deficit-reduction compromise that involved both spending cuts and tax increases. Panetta writes that the compromise required courage, vision and leadership. He laments that these qualities are in short supply in 2014.

Panetta’s mastery of the federal budget made him President Bill Clinton’s choice in 1993 to lead the Office of Management & Budget. He recounts the first Clinton budget, which faced a rising $290 billion deficit and required both spending cuts and tax increases. Panetta’s stewardship saw the bill pass by just one vote in both the House and Senate. By 1998, the budget deficit had disappeared and, by 2000, showed a $236 billion surplus. He notes that Clinton considers the 1993 budget package as the “most important domestic decision of my presidency.”

Tapped by Obama to be director of the CIA, Panetta writes that he succeeded in the post because he chose an excellent chief of staff (Jeremy Bash), respected the institution, developed a good rapport with senior agency officials, and did not come in with an “entourage” bent on cleaning house.

Panetta’s finest hour at the CIA was orchestrating the hunt for bin Laden. His description of the operation does not disappoint. The most compelling part of the book is the 40-page chapter in which he recounts the painstaking two-year investigation and the inter-agency planning that culminated in the May 1, 2011 raid.

Panetta writes that when he arrived at the CIA in 2009, Obama instructed that he prioritize efforts to locate bin Laden, a task that Bush had put on the back burner. He also writes that, when the CIA became convinced that it had located bin Laden, Obama, mindful that this decision could wreck his presidency, courageously chose to carry out the raid without consulting the Pakistani government, which he did not trust. With the success of the raid, this bold decision was vindicated. Panetta’s account debunks the charge that Obama only “leads from behind.”

In mid-2011, Panetta was appointed to be the new Secretary of Defense when Robert Gates retired. His chief mission was to wind down the foreign wars and recommend future cuts in Pentagon spending without hollowing out the military. However, he will most likely be remembered for three measures that improve the quality of life of women and gays in the armed forces. First, he opened up 14,000 posts in the military that had previously been off-limits to women. Second, he instituted new regulations to handle the 26,000 sexual assault and harassment cases that take place each year in the armed forces. Third, he eliminated the “Don’t Ask, Don’t Tell” policy that unfairly stunted the careers of thousands of gay service personnel. For Panetta, these long overdue measures are a matter of decency and justice.