Cuba did not like Spain one bit—and had tried to win their freedom twice before—but this was the war that did it (third time's a charm, right?). The conflict eventually turned into the Spanish-American War, which as you can probably tell from the name involved mostly the heavy-hitters Spain and the United States.
Now here's a nasty fellow if there ever was one (you don't earn the nickname "The Butcher" for nothing). Spain had been losing parts of Cuba to the revolutionaries, so they sent Mr. Butcher to handle things.
Valeriano Weyler threw Cubans into concentration camps, abused and tortured thousands of them, and let many starve to death or die of diseases. Super nice guy.
The U.S. hadn't gotten involved in the whole Cuba-Spain mess yet, but they were a bit worried about how things were going in their southern island neighbor (especially after hearing about The Butcher's actions). President McKinley decided to send a single battleship called the USS Maine down to Havana (Cuba's capital) to keep an eye on things.
"Remember the Maine, to hell with Spain!" became the unofficial American battle cry after—you guessed it—the Maine was blown up right offshore of Cuba.
This event put America 100% into the conflict between Cuba and Spain, because most Americans believed that Spain had sabotaged the battleship. The truth is a bit more complicated than that—in fact, we still don't know today how the ship blew up. It could have been Spain, it could have been an engine malfunction…or it could have been something else.
Whoever blew up the Maine, it no longer mattered because America was now fully invested. Maybe the U.S. was feeling compassionate toward Cuba or maybe the U.S. saw an opportunity to grab some islands from Spain.
Either way, Congress demanded Cuba's independence and gave the President McKinley permission to declare war. A pretty key detail here was the Teller Amendment—a document signed by Congress saying that no matter what, the U.S. would not take over Cuba as part of this whole war.
Spain didn't like the U.S. bossing them around with demands or blockading Cuba (which was Spain's island, after all), so they said "Guerra!"
To which the U.S. said, basically, "Yeah, we've been at war for a few days here, guys." Maybe it all got lost in translation.
This was a battle that all the history books love to talk about, and although it didn't involve Cuba, it was pretty huge for the whole America taking over islands thing. Which is what the Spanish-American War and the Platt Amendment were really about—control over other islands.
Probably one of the most one-sided battles ever, the American Navy utterly smashed Spain's armada at Manila Bay (Philippines). And we mean completely demolished. Spain lost all of their ships, and the U.S. had a single casualty—from sunstroke. U-S-A!
The most famous battle that did happen in Cuba was at San Juan Hill. It was an American victory against the Spanish, involving the famous Rough Riders. These dudes were a hardy bunch of cavalry soldiers led by none other than Teddy Roosevelt, future President of the United States (spectacles and all).
The victory boosted American morale and crushed Spain's hopes of keeping their island.
After a string of military losses, Spain knew they couldn't win. Their heyday as an empire was over (hey, they had a pretty good run). The peace treaty was signed in Paris, and America made out like a bandit. The U.S. gained control of Guam and Puerto Rico and administrative control over Cuba and the Philippines.
(Just FYI: the U.S. still controls Guam and Puerto Rico today as territories, but there was a Philippine-American war later that resulted in independence for the Philippines.)
Since the U.S. had "administrative control" over Cuba according to the Treaty of Paris, it could set the rules. And set them it did. Congress came up with the Platt Amendment—seven rules for Cuba—that pretty much let the U.S. intervene whenever and wherever it saw fit.
Not that Cuba really wanted to put the Platt Amendment into their constitution, but it pretty much had to. The U.S. had an army in Cuba and was the whole reason Cuba won its independence. Once it was in the constitution, Cuba was only independent in name, with much of the control held by the U.S.
Lasting about thirty years, the Platt Amendment was removed by President Franklin D. Roosevelt during the Great Depression. This was part of FDR's "Good Neighbor policy" that included not only Cuba but many countries south of the U.S.
It's important to note that not all of the Platt Amendment is completely gone today—the U.S. still holds a small piece of Cuba in Guantanamo Bay.