The Nicaraguan Revolution was caused by animosity by the people who resented the way the ruling regime was using its powers.
In particular, the general population were extremely unhappy to live under the Somoza family who had had a dominant role in ruling the country since the 1930s.
The Somoza's form of government has been classified as a dictatorship. But the aspirations and political position of the subjects of that regime became strongly inclined towards socialism.
This conflict of ideologies was the fundamental cause of the Nicaraguan revolution.