In Sienkiewicz's work, he depicted the Siege of Zbarazh as so:
The poles built wooden/earth fortifications outside the walls of Zbarazh to prevent cannons from being brought close enough to attack the walls and protected the fort using WWI-like trenches.
The Khmielinsky met with Jeremy, demanding surrender.
After surrender was refused, the poles celebrated with fireworks and cannonfire during the night and the Cossacks were threatened by their tatar allies for no easy capture.
The next day, the cossacks stormed the trenches outside Zbarazh on foot and horse, and were promptly beat back by the charge of winged hussars and dragoons countering them.
Afterwards, the siege is depicted as both sides shelling each other with artillery for weeks and night-time raids trying to sabotage the other side's artillery and fortifications.
Why did the cossacks try and force an engagement over the trenches?
The poles sallying forth makes sense - they had limited food and needed to break out to clear space for a messenger to request back up, and they needed the trenches to block artillery from threatening the walls proper.
But why did the cossacks engage before the poles sallied out? They were fighting uphill and into artillery fire and cavalry charge when they had the logistical and numbers advantage over a siege.
Although the idea of just camping around the besieged location, waiting for the defenders to surrender or die of hunger seems to be logical, it is only so in the situation where the siege itself is completely isolated from other factors, what is rarely the case in reality. In war, situation tends to change, sometimes rapidly, and thus a simple waiting might not always be the best course of action. It should be noted that the siege requires commitment of the forces and any soldier assigned to keeping it is one soldier less to fight in another place. In addition, 'starving defenders' is a viable plan only when the besieger controls the entire territory and has access to supplies or can source them from the vicinity. If the situation is precarious, it is possible for the besieging side to suffer hunger too, in an extreme case it might even be more affected by it than the defenders should the latter has stockpiled substantial amounts of food inside.
Now, we need to take into account factors specific to the Eastern Poland in the late 17th century and to the Khmelnytsky's Uprising in particular. One of the factors that might have influenced the decision of an assault was the fact that the interests of Tatars and Cossacks were not aligned to any significant degree and thus the former were only temporary, opportunistic allies who could have walked away after making a separate agreement with Poles or getting involved in another, more profitable conflict or in a worst-case scenario, they could have allied with their former opponents against Cossacks. Khmelnytsky knew that prolonged Siege of Zbarazh could have been construed by Islam Gerey III as dragging one's feet and he didn't want to risk losing a valuable ally. These suspicions were not without merit, as during the battles fought near Zborów between the Cossack-Tatar forces and the Polish contingent moving to relieve Zbarazh, Tatars were reluctant to participate, showing disappointment of the khan, who eventually decided to negotiate with Poles. Another important factor was the arrival of the Polish relief forces that could have caught the Cossack-Tatar army in the field, and although this threat eventually turned to be much less dangerous than anticipated, it still had to be accounted for.
It is also important to understand the numerical advantage attackers had. Although accurate estimation is not an easy task due to the differing values presented by various contemporary authors, including those present at Zbarazh, it is safe to assume that the Polish forces located in the fortress numbered some 10-14 thousand people, while Khmelnytsky commanded at least 70.000 Cossack combatants with hard to estimate force of Cossack peasants who, although presenting rather low combat value, could have still been instrumental due to their number, thought to be anything from half the number of the main Cossack forces to being equal to the latter. With Islam Gerey III bringing with him 35-40 thousand Tatars, the defenders were outnumbered at least one to ten, quite possibly even more. With such a numerical advantage, Khmelnytsky could have tried to capture the city by assault, repeating the tactics Mongols used against cities of Kievan Rus' in 13th century.
Some historians also attribute the decision to a sort of overconfidence that Khmelnytsky could have felt after the victory at Żółte Wody (now Zhovti Vody, Ukraine), annihilation of the Polish troops in an ambush near Korsuń (now Korsun-Shevchenkivskyi, Ukraine) and panic retreat of Polish forces from Piławce (now Pylyavci, Ukraine) shortly before. In the latter case, Polish army, composed chiefly of the provincial forces and led by three commanders two of whom lacked military knowledge and experience - Mikołaj Ostroróg was known for his political acumen rather than military skills while Władysław Zasławski-Ostrogski lacked any military or commanding experience and was considered generally incompetent by his contemporaries. It is suggested that the commanders were deliberately chosen by the Great Crown Chancellor, Jerzy Ossoliński to present low threat to Cossacks and increase the chances of negotiations with Khmelnytsky, possibly to use the Uprising to decrease the power of the nobility to the benefit of the king (Ossoliński was a staunch royalist and was also partial to the idea of strong central power that became par of the course in many other European states in 17th century). Regardless, morale in the mixed private and royal army was very low and the Polish troops eventually withdrew and then retreated without engaging the enemy. This event likely caused the Cossack leader to correctly assume that the morale of the opponent was exceedingly low what possibly led to the conjecture that the defenders of Zbarazh will present similar will to fight. But the Polish army in the fortress also consisted of the private forces of Jeremi Wiśniowiecki and thus was defending their own land, while being commanded by well-liked and very competent leader, making their loyalty and resolve exceptionally high, what increased the general morale during the initial phases of the siege.
The risks and eventually futility of the assaults were noticed by Tatar chronicler, Hadji Mehmet Senai, present at the siege, who wrote that Poles were very well entrenched while their morale and skills were very high, and so the attackers should rather have encircled and harased them with artillery barrage waiting for the morale to dwindle and the resources to run out.
Kołodziejczyk, D., The Crimean Khanate and Poland-Lithuania, Brill 2011.