Castro's government found out about the invasion plans and there were 20,000 soldiers ready to fight off the 1,400 invaders.
The USA and exile army falsely assumed that most Cubans would support, but in actual fact, most felt happy with Castro and so didn't want to help overthrow him.