They had to go in the cave because of the bad weather outside. It states, "In the small hours of the third watch, when starsthat shone out in the first dusk of evening had gone down to their setting, a giant windblew from heaven, and clouds driven by Zeusshrouded land and sea in a night of storm;so, just as Dawn with fingertips of rosetouched the windy world, we dragged our ship835 to cover in a grotto, a sea cavewhere nymphs had chairs of rock and sanded floors" (paragraph 830).
They had killed Helios kine and got mad. It states, "And the Lord Heliosburst into angry speech amid the immortals:‘O Father Zeus and gods in bliss forever,punish Odysseus’ men! So overweening,now they have killed my peaceful kine, my joy910 at morning when I climbed the sky of stars,and evening, when I bore westward from heaven.Restitution or penalty they shall pay—and pay in full—or I go down foreverto light the dead men in the underworld.’ (paragraph 905).
Zeus gets mad and strikes the ship with a thunder, while the crew mates were on it and they all were sent to the sea. It states, "We held our course, but briefly. Then the squallstruck whining from the west, with gale force, breakingboth forestays, and the mast came toppling aftalong the ship’s length, so the running riggingshowered into the bilge.On the afterdeck945 the mast had hit the steersman a slant blowbashing the skull in, knocking him overside,as the brave soul fled the body, like a diver.With crack on crack of thunder, Zeus let flya bolt against the ship, a direct hit,950 so that she bucked, in reeking fumes of sulphur,and all the men were flung into the sea.They came up ’round the wreck, bobbing awhilelike petrels76 on the waves."