Commerce raiding
Privateering: The first sort of commerce raiding was for nations to commission privateers. Early instances of this type of warfare were by the English and Dutch against the Spanish treasure fleets of the 16th century, which resulted in financial gain for both captain and crew upon capture of enemy vessels ("prizes").

17th and 18th centuries: Privateers formed a large part of the total military force at sea during the 17th and 18th centuries. In the First Anglo-Dutch War, English privateers attacked the trade on which the United Provinces entirely depended, capturing over 1,000 Dutch merchant ships. During the subsequent war with Spain, Spanish and Flemish privateers in the service of the Spanish Crown, including the notorious Dunkirkers, captured 1,500 English merchant ships, which provided a major boost to the flagging Dutch trade. Dutch privateers and others also attacked English trade, whether coastal, Atlantic, or Mediterranean, in the Second and Third Anglo-Dutch wars.
During the Nine Years' War, French policy strongly encouraged privateers, including the famous Jean Bart, to attack English and Dutch shipping. England lost roughly 4,000 merchant ships during the war. In the following War of Spanish Succession, privateer attacks continued, Britain losing 3,250 merchant ships. Parliament passed an updated Cruisers and Convoys Act in 1708, allocating regular warships to the defence of trade.
In the War of Austrian Succession, the Royal Navy was able to concentrate more on defending British ships. Britain lost 3,238 merchantmen, a smaller fraction of her merchant marine than the enemy losses of 3,434. While French losses were proportionally severe, the smaller but better-protected Spanish trade suffered the least, and Spanish privateers enjoyed much of the best plunder of enemy merchantmen, particularly in the West Indies.

Napoleonic Wars: During Britain's wars against Revolutionary and Napoleonic France, the Royal Navy dominated the seas. France adopted a guerre de course strategy by licensing civilian privateers to seize British shipping.  British East Indiamen of the time were therefore heavily armed to protect themselves against such raids, at the cost of considerable speed and maneuverability.  Some East Indiamen, such as Arniston, were successfully able to fend off these attacks in other parts of the world; others, such as when Kent met Confiance in 1800, were less fortunate.
U.S. and British privateers also actively raided each other's shipping during the War of 1812.

American Civil War: During the American Civil War, the Confederate Navy operated a fleet of commissioned Confederate States Navy commerce raiders. These differed from privateers as they were state-owned ships with orders to destroy enemy commerce rather than privately owned ships with letters of marque.

Steel navies: By the 1880s, the navies of Europe began to deploy warships made of iron and steel. The natural evolution that followed was the installation of more powerful guns to penetrate such warships, followed by specialized armor plating, followed by larger guns and the development of effective torpedoes (followed by armored belts below the waterline to protect against them).  This "arms spiral" (which included the development of high explosive and armor-piercing shells) shifted focus from capture of "prizes" (that meant financial gain for captain and crew of the responsible vessel, and their government, when the prize and her cargo were auctioned) to destruction of enemy warships.
First seen at the Sinope in 1853, the change was little appreciated until 1905, when at Tsushima seven pre-dreadnoughts were sent to the bottom, and the only prizes were those that had voluntarily surrendered.

World War I: World War I saw Germany conducting a commerce war ("Handelskrieg") against Britain and her allies, principally with U-boats, but also with merchant raiders and light cruisers, and even occasionally with naval airships.

World War II: During World War II, the Battle of the Atlantic saw Nazi Germany conducting commerce raiding against Britain and its allies, again using U-boats, auxiliary cruisers, and small groups of cruisers and battleships (surface raiders).  The goal was to wage a tonnage war against the British Empire, destroying merchant shipping (and its cargoes) faster than they could be replaced, ultimately strangling the island nation by cutting off supplies it was inevitably dependent upon.
Limitations set by the Treaty of Versailles meant Germany had been unable to build a large battle fleet between the World Wars as she had in the time leading up to the World War I; instead, she chose to covertly develop her U-boat fleet. Submarines were cheaper and quicker to build than capital ships. This meant Germany was not able to fight battles between fleets, and relied on commerce raiding instead.  The extreme early success of Kriegsmarine U-boat wolfpacks led to the Allied development of an extensive and naval resource-straining convoy system.
In addition to U-boats Germany also deployed the small numbers of surface warships she possessed, such as the Deutschland "pocket battleships", her auxiliary cruisers, and a number of commercial vessels converted into merchant raiders, perhaps the most famous being Atlantis.
During World War II, elements of the United States Navy based in Brazil conducted operations in the Atlantic against German commerce raiders and blockade runners. In the Pacific, the U.S. Navy operated against Japanese merchant shipping, as well as engaging in offensive operations against ships of the Japanese Imperial Navy. The bulk of the Japanese merchant marine was sunk by American submarines. By the end of the war, only 12% of Japan's pre-war merchant tonnage was still afloat.
The Indian Ocean raid was a naval sortie by the Carrier Striking Task Force of the Japanese Navy from 31 March to 10 April 1942 against Allied shipping and bases in the Indian Ocean. It was an early engagement of the Pacific campaign of World War II.
The staff of the Imperial Japanese Navy decided to send some raiders to Indian Ocean waters during December 12, 1941 – July 12, 1942. The Germans had already been operating in the area and conducted mutual aid with Japanese submarines, in the form of re-supply and military intelligence. The Indian Ocean was the largest operating area involving direct contact between the two Axis partners, in which their primary objective was to keep pressure on the shipping lanes.  The Japanese Navy participated in some commerce raiding, but concentrated its efforts toward a "decisive battle" in the Pacific, which never took place.

See also: Axis naval activity in Australian waters
Demoralization (warfare)
German auxiliary cruiser Atlantis
Indian Ocean raid
Japanese raiders in Indian Ocean Campaign
Merchant raider
Naval strategy
Piracy
Privateer
Q-ship
Tonnage war
Unrestricted submarine warfare

Notes: 

References: L, Klemen (2000). "Forgotten Campaign: The Dutch East Indies Campaign 1941–1942". Archived from the original on 2011-07-26. Retrieved 2021-03-30.
Lehmann, Ernst A.; Mingos, Howard. The Zeppelins: The Development of the Airship, with the Story of the Zepplin Air Raids in the World War. *

Further reading: Brown, David. Warship Losses Of World War II. 1995. ISBN 1-55750-914-X.
Blair, Clay, Jr. Silent Victory. Philadelphia: Lippincott, 1975.
Mahan, Alfred, Captain. Influence of Seapower on History.
Reeman, Douglas. The Last Raider. Arrow Books. ISBN 0-09-905580-5. Novel detailing the last voyage of a WWI German commerce raider.
Chapter VI: "THE NORTH SEA PATROL—THE ZEPPELINS AT JUTLAND"(online chapter).