Norway has a long history as a maritime nation - the country's name is owed to the importance of the sea: "Norway" = "The North Way", Norwegian coastal waters as a vital transport route. Internally, Norway depended on the sea to connect its coastal settlements, and to connect with its overseas vassals. Fishing was an essential part of the economy, and was a large part of Norway's international trade. For a long time, Norway's ships mostly served local needs, with late Medieval international trade with Norway mostly carried by German and Dutch ships. In the 17th century, Norwegian involvement in international shipping grew, first in the Baltic and the North Sea. As a timber exporter, Norway benefited from the Great Fire of London, and with a Norwegian government decree that timber exports were to be carried in Norwegian ships, the number of Norwegian ships grew. This was the start of a long-term trend, and by 1700, Norway had a large and modern merchant fleet, of about 1,000 ships. Norway's maritime fortunes fluctuated over the next century and half, with British blockade during the Napoleonic Wars hurting Norwegian trade, and competition with Denmark and Sweden (and the change from Danish rule to Swedish rule), but Norway maintained a large merchant fleet throughout that time. From about 1840, there was new growth - prior to this, Norwegian ships mostly carried goods to and from Norway, but they now entered the wider international shipping market, carrying goods between any ports. From 1840 to 1880, Norwegian merchant shipping tonnage increased by a factor of 6, making the Norwegian merchant fleet the third largest (soon dropping to 4th largest, which Norway maintained until WW2).
The Norwegian shipping industry was successful and profitable, and it attracted continuing investment, which allowed continued growth. In 1900, Norway controlled about 3.5% of the world's merchant shipping (the UK fleet was about 10 times larger, the German fleet about 2 times large, the US fleet about 75% larger, and the French fleet about 10% smaller), which continued to increase to a peak of about 10% in 1967. While the British fleet was larger in 1900, Norway's fleet was largest in per capita terms: about 1.2 tons per capita, compared with Britain's 667kg per capita, and Denmark's 405kg per capita.
By 1939, Norway's merchant fleet was about 4.8 million tons, 4th behind the UK, USA, and Japan. This was about 7% of the world's merchant tonnage. However, this understates the value of the Norwegian fleet: it also included 18% of the world's tanker tonnage, and 40% of the world's independently-owned tanker tonnage. When Germany invaded Norway, Norway switched from neutrality to being one of the Allies, and Norwegian ships at sea, and in Allied and neutral ports, were requisitioned by the Norwegian government for the duration of the war. This brought about 1,000 ships with a total tonnage of about 4.1 million tons to the Allies.
With so many Norwegian ships, many of the merchant ships sunk were Norwegian - about 700 ships, and 3,670 Norwegian sailors killed (and about 1,000 non-Norwegian sailors killed on Norwegian ships).
As noted above, Norwegian shipping peaked in 1967 at about 10% of the world's merchant shipping, and declined to about 4% by 2001. However, this only counts Norwegian-flagged ships, and 53% of Norwegian-owned merchant shipping in 2001 sailed under foreign flags. Including these foreign-flagged ships, the Norwegian fleet was 8% of the world's fleet, 3rd behind Greece (19.1%) and Japan (13.2%). Since 2001, the Norwegian share has dropped further, to share 6th place with the US in 2010. Greece and Japan still held the top two spots, with similar percentages as in 2001, but China, Germany, and South Korea had climbed ahead of Norway (and the USA).
References and further reading:
Stig Tenold, Norwegian Shipping in the 20th Century, Palgrave Macmillan, 2019. https://doi.org/10.1007/978-3-319-95639-8 [OPEN ACCESS]
For the 2010 data: Jari Ojala and Stig Tenold, "Maritime trade and merchant shipping: The shipping/trade-ratio from the 1870s until today", 2016. https://core.ac.uk/download/pdf/52135043.pdf