Castro came to power in an armed revolution. On taking over he revamped the military and got Soviet help. The Cuban army is small and consists of about 80,000 combat troops. It was a small but dedicated force which is basically used to suppress the local populace.
Castro and military
Cuba under the dictator Batista was an ally of the USA. Americans lorded it over Cuba and American business controlled almost 90% of Cuban industry. Come Castro and all that changed. Castro ushered in a Communist/Marxist regime and nationalized American interests as he moved closer to the Soviet Union.
The Americans were numbed by the swiftness of events and with approval from General Eisenhower the CIA cobbled a force of Cuban expatriates and invaded Cuba. Known as the Bay of Pigs invasion, it failed and Americans were left wondering what happened.
After the Missile crisis of 1962, though Cuba had an extremely tiny military force compared to the USA, yet no invasion was ever carried out. The Cuban army consisted of about 80,000 soldiers with a small arsenal of tanks and guns (all of Soviet origin). The Air Force has just about 80 aircraft, of which 39 are interceptors/fighters. These are also of Soviet design and are vintage models of the MIG. It also has 12 helicopters and no gunships.
The Cuban navy is its weakest link with 12 ships (most of which are just coastal defense gunboats).
Cuban military role
The role of the Cuban armed forces was basically internal security duties as they were covered with a defense pact with the Soviet Union. Despite this, the USA could have easily wiped out the Castro regime. The reason it never did this was the promise given by Kennedy not to destabilize the Cuban government as a quid pro quo in return for removal of Russian missiles from Cuba.
The USA honored that undertaking and Castro survived.
The small Cuban armed forces have not been tested in any battle after the fall of Batista and are basically the second line in addition to the police to keep watch over the Cuban people.