What is Transit Passage?

Legal Definition
Transit passage is a concept of the Law of the Sea, which allows a vessel or aircraft the freedom of navigation or overflight solely for the purpose of continuous and expeditious transit of a strait between one part of the high seas or exclusive economic zone and another. The requirement of continuous and expeditious transit does not preclude passage through the strait for the purpose of entering, leaving or returning from a state bordering the strait, subject to the conditions of entry to that state.

This navigation rule is codified in Part III of the United Nations Convention on the Law of the Sea. Although not all countries have ratified the convention, most countries, including the US, accept the customary navigation rules as codified in the Convention. This navigation rule took on more importance with UNCLOS III as that convention confirmed the widening of territorial waters from three to twelve nautical miles, causing more straits not to have a navigation passage between the territorial waters of the coastal nations.

Transit passage exists throughout the entire strait, not just the area overlapped by the territorial waters of the coastal nations. The ships and aircraft of all nations, including warships, auxiliaries, and military aircraft, enjoy the right of unimpeded transit passage in such straits and their approaches. Submarines are free to transit international straits submerged since that is their normal mode of operation. The legal regime of transit passage exists in the most important straits for the international trade exchange and security (Strait of Gibraltar, Dover Strait, Strait of Hormuz, Bab-el-Mandeb, Strait of Malacca).

Transit passage rights do not extend to any state's internal waters within a strait.
-- Wikipedia