From a number as sources I’ve read it seems as though both sides were waiting for the other to do something for a while beforehand, and also that if they had not fired it might have been possible to negotiate leaving the Union.
The Confederacy had been occupying federal property (e.g., forts and mints) throughout the winter and early Spring of 1861. However, Ft. Sumter was on an island and was an important fort. The Confederacy was hoping to play a waiting game, and once the Union soldiers ran out of supplies and food, they'd occupy the fort. However, Lincoln ordered the fort be resupplied. If the Union was willing to resupplied the fort, that meant that they'd be able to guard the entry to one of the South's most important harbors. The Confederacy needed to make a choice, take the fort by force, or let it be resupplied. They chose the former.