As to how one advances to become a captain, it is probably the same in most countries. All merchant officers must be licensed to sail on the ships of the country of registry of the ship. There are two areas of competence, one is a deck officer (or Mate) the other in an Engineer.

Mates can advance to become a Captain, and Engineers advance to become a Chief Engineer. In the United States, licenses are granted by the U.S. Coast Guard after a candidate has proved that he has the experience (sea-time) in a lower grade, and also passed an examination to prove his proficiency in the knowledge of the license for the grade he is seeking. About half (my estimate) of the candidates for the lowest grade of officer (3rd Mate or 3rd Assistant Engineer) come from 4 year universities that offer degrees in the maritime field. These are the State and Federal maritime academies. "Academy Graduates" will have spent about a year of their 4 years at sea on training ship cruises, or as cadets on regular merchant ships.

The other half are those who have sailed in unlicensed positions, as Able Seamen, Oilers or Machinists. They all have to demonstrate sea-time and pass the examination. After sailing for a year as a 3rd mate or engineer, you are eligible to sit for the next exam, that of 2nd mate or engineer. After a year as 2nd, you are eligible to sit for the 1st mate or engineer license, and after a year as 1st, you can finally sit for a Master's license or a Chief Engineers license.

Since the maritime industry is a cyclical business, with economic down-turns common, it is not always possible for a person to sail at the limit of his license. When times are bad, many companies require a person to hold a license one grade higher than his billet. Only time sailing counts, so that time lost between jobs or on vacation does not count. For these reasons it usually takes a person from 10 to 20 years, or more, "at sea" to become a Master or Chief Engineer. Having the license does not guarantee the job, either. On my later trips at sea most of the officers sailing with me had Master's licenses. You have to be in the right place at the right time, you have to keep and keep in the good graces of your employer. You have to operate the ship causing few problems for the company. You must keep labor disputes and political problems to a minimum.

There are always many people who would like to have your job. Sailing as a Master on a merchant ship is something of an ego trip, but you must not get a "swelled head" or sense of self importance. Everyone addresses you as "Captain" and says "yes sir". It is a position similar to that of a Physician in the medical field, or a Judge in the Legal profession. I was fortunate in that every time I made a few trips to sea, I would return home for awhile and change diapers or clean bathrooms while my wife worked. I was able to maintain perspective on life.