In the first scene on Master and Commander after the ship beats to quarters they're shown lowering three rowboats and towing them behind the ship. Why do they do that?
The boats of a Napoleonic warship were a very important part of the ship's equipment. They were the main means (and often the only means) of moving men, goods and communications to and from the ship.
The number of boats carried and their size would be dependent on the rate of warship. A ship-of-the-line could have as many as 7 boats, while an unrated sloop-of-war would still have 3-4.
The larger boats would often have a mast and rigging allowing them to be sailed as well as being rowed. This gave them some independence from the ship itself and they were fairly seaworthy (Captain Bligh managed to navigate his ship's launch over 3,600 miles after the mutiny).
Until the wide-spread adoption of the davit (which only started to be introduced at the start of the French Revolutionary war), lowering and raising the ship's boats involved tackle suspended from the fore and main yardarms. This could be a very tricky operation to perform in the midst of a battle.
Therefore, in addition to keeping the spar deck clear (as noted in CGCampbell's answer), it made sense to tow some or all of the ship's boats as this allowed them to be available for action much more readily. In action, the ship's boats would be used for a number of purposes - as lifeboats (to rescue any seamen of either side who fell into the sea), as weapons (boarding actions of the period usually used the boats rather than bring the ships together) and for communications (transferring orders too complex to send via the flags).
Source: The Boats of Men-of-war, W.E.May (Caxton, 2003)
Beat to quarters is what has become General Quarters in the modern navies. It was the call to ship's company to prepare for action/battle. All crew would prepare for action, depending on the reason for BtQ. (BtQ would be called during storm preparation as well as battle prep, for instance)
The cannon crew would ensure their cannon were properly tied for the action, and pulled all the way to the rear of their lines. Water would be laid for the swabs, the linstocks would all be lit, the balls stacked close at hand and the gunpowder readied.
The rates would scamper up the ratlines to stand by for maneuvering changes to the sheets. Extra rigging would be laid out, out of the way. The marines would take their positions, and light their linstocks, or prime their flints.
The ship's surgeon would prepare his table and instruments in the mess, while the cooks would heat water (for fire control and for the surgeon).
Finally, the dinghies would taken down and lowered into the water and taken in tow. This was done to clear the decks for combat. They would only be in the way of the marines and would be in more danger of being holed or destroyed from cannon fire (from the enemy).
These were some of the main things that might happen during a BtQ for combat. Many other items would be done as well, however.
In addition to the above in engagements boats on deck would have been vulnerable to damage by enemy cannon fire. The splinters would have been more lethal than the missile, hence they were lowered to avoid that risk.