Answer:
With Cuba being so close to the United States the Soviet Union could use the nukes they placed in Cuba to hit the most important parts of the United States, The Soviet Union and Cuba both wanted to expand communism, and this relationship between Stalin and Castro, was an economic one so Stalin could send military personal to Castro and this helped Cuba stay defended if the U.S launched a high risk attack.
The alliance affected the relationship between Cuba and the US by Cuba being watched by the Soviet Union so any time an attack was held on cuba it was most likely an illegal one or a very high risk spy mission, so the Americans were consistently in the red entering Communist Cuba and at risk of setting off nuclear war.