And when they board a ship, they supplicate Allāh, sincere to Him in religion [i.e., faith and hope]. But when He delivers them to the land, at once they associate others with Him
When the idolaters board ships and sail the ocean, they call out to Allah alone, sincerely supplicating to Him to save them from drowning. After Allah saves them from drowning, they return to their idolatry, calling out to their idols together with Him.