This is a war going back to centuries in the past that has to do with the holy land Israel occupies. Basically, Hamas was not given control of Gaza nor elected but it was a Palestine controlled area given over by Israel that was overrun by Hamas and now under their control. Hamas starts the warfare, asking Israel to give over border control to allow people to go in and out as they please and reality is, if they did this Hamas will still not stop.
They will not stop until the destruction of Israel of a whole and has majority of arabs involved against Israel as well as they do not recognize the country as what it is and want it controlled by Pakistan.
This war will go on forever for Israel whether Hamas or someone else. Personally, I support Israel and don't blame them for firing back. What the Hamas are conducting is cowardly attacks, and ironically when Israel retaliates the world gets in on it and poster childs them up as the guilty side showing mainly the innocent victims that are caught up in the cross fire yet do not show this when Hamas does their routine of dropping hell down wherever they feel like it. Hamas has no directives nor key strategy for eliminating areas of Israel, only to fire randomly and hurt whomever they can within the country whereas Israel aims for taking out their military strategic key points to eliminate their ability to fire anymore rockets into Israel and only then will Israel back away.
No matter how it ends, Israel will always be looked upon at fault by many if not most.