Iran built thousands of fast-attack speedboats which patrol the strait, get up close, fire a few missiles, and quickly return. This video gives a good explanation of their strategy. https://www.youtube.com/watch?v=GKJHaODzP-0
This can be mitigated by the US/Gulf Countries, with a large number of airplanes / drones patrolling the Iranian shore, and preventing these boats from launching.
More information here https://news.sky.com/story/iran-unveils-underground-naval-ba...
2. Now that the region is a "war zone", no insurance company will cover ships entering/transiting the strait. This was an issue during the Iran-Iraq war only solved by US Naval vessels escorting tankers. At that time, hitting a US ship would have started a war. This time, the US is an active participant in this war and every ship escorted by US ships would be a valid/legitimate military target. Shipping companies work on razor thin margins and cannot afford the risk themselves. Losing one ship (or it being out of service for months due to missile strikes) is an existential threat to the smaller shipping companies.
And for US and/or Israel to prevent it, they would have to occupy the correspondingly wide strip of Iranian coast. At which point we're talking about a massive ground invasion (and of course then the same artillery would be firing at those troops, so you can't really just stop there either).
During Desert Storm, US batteries returned fire before enemy rounds even hit apogee.