The in-universe explanation is that much of the geography of Middle-earth is not the result of natural processes, but rather of mythological events, conflicts, etc.
Some quotes from the Silmarillion, various chapters:
And the Valar drew unto them many companions, some less, some well nigh as great as themselves, and they laboured together in the ordering of the Earth and the curbing of its tumults.
...and they built lands and Melkor destroyed them; valleys they delved and Melkor raised them up; mountains they carved and Melkor threw them down; seas they hollowed and Melkor spilled them...
In that time the Valar brought order to the seas and the lands and the mountains...
And the shape of Arda and the symmetry of its waters and its lands was marred in that time, so that the first designs of the Valar were never after restored.
...the Valar fortified their dwelling, and upon the shores of the sea they raised the Pelri, the Mountains of Aman, highest upon Earth.
In the changes of the world the shapes of lands and of seas have been broken and remade; rivers have not kept their courses, neither have mountains remained steadfast...
Melkor met the onset of the Valar in the North-west of Middle-earth, and all that region was much broken.
In that time the shape of Middle-earth was changed, and the Great Sea that sundered it from Aman grew wide and deep; and it broke in upon the coasts and made a deep gulf to the southward.
But the mountains were the Hithaeglir, the Towers of Mist upon the borders of Eriador; yet they were taller and more terrible in those days, and were reared by Melkor to hinder the riding of Orome.