According to the book Spymasters of Israel, the Israelis had identified the USS Liberty as a spy ship which was leaking vital intel coms to Russia because it was compromised. They asked the US DoD to remove it, the US refused. They did what they had to do during wartime to remove the threat.
https://stephenlendman.org/2019/08/27/israels-infamous-uss-
In 1972, IDF chief General Haim Barlev said: “We were not threatened with genocide on the eve of the six-day war, and we had never thought of such a possibility.”
Knowing it faced no regional threats, Israel preemptively and aggressively attacked four nonbelligerent Arab states and its key US ally without just cause.
It was no accidental IDF attack on the USS Liberty. Israel knew the ship’s identity, its US flag clearly visible. Good weather conditions made it easy to spot.
Israeli warplanes circled overhead before attacking, at times low enough for US sailors to wave to its pilots.
They waved back before opening fire with rockets, machine guns, and napalm terror-bombs against the lightly armed vessel.
Parts of the deck were set ablaze. Torpedoes launched from IDF boats caused a 40-foot-wide hole in its hull, flooding lower compartments, causing the ship to list 10 degrees, a defenseless smoking hulk, lucky to avoid sinking.
The ship’s radio frequencies were jammed to prevent a distress call for help. When finally able to communicate, it was too late. The damage was done, the human toll testimony to Israeli viciousness.liberty-attack/