The assassination of president Kennedy took place in the midst of two largely secret wars that the Kennedy brothers(president John F. Kennedy and Attorney General Robert F. Kennedy) were waging concurrently, one against organized crime and the other against Fidel Castro, the leader of Cuba.
The war against organized crime was largely Robert F. Kennedy's pet operation, but it was carried on with full backing of his brother, the president.
Robert F. Kennedy also played a major role in the struggle to overthrow Fidel Castro, but it was essentially an effort carried on by the CIA in alliance with the Cuban exiles.
By the time the Kennedy's came to power, organized crime and its pawns in organized labor, like Jimmy Hoffa and the teamster's union, had become enormously powerful and arrogant.
The Mafia bosses, inebriated with their power, and essentially unchallenged by the federal Government, had become arrogant and spoiled.
They basically thought that they could get away with anything. Even J. Edgar Hoover himself aided Mafia advancement. Finally Robert F. Kennedy forced Hoover to face up to the organized crime.
The accession of the Kennedy's to power brought a radical change in the relationship between the Federal Government and the Mafia families. Under the Kennedys there were to be no compromises with the Mafia. It was to be an all out war. This was the first time in US history that the executive branch of the government was to lead the fight against organized crime. After the debacle of the failed Bay of Pigs invasion, President Kennedy's Cuba Study Group came to the conclusion that "there can be no long-term living with Castro as a neighbor" and the president accepted this conclusion. Accordingly, in the summer of 1961, the Kennedy's launched a massive campaign to overthrow Fidel Castro,