They kind of lay it out in the episode where the Unsullied take Casterly Rock. Euron’s naval force destroyed their fleet and exit via sea, and the Lannister army had abandoned the castle with little food and supplies. Knowing they couldn’t hold the castle without those supplies, it forces the Unsullied to abandon the…