The quarterdeck (or quarter-deck) is a naval term. In the age of sail, the quarterdeck was defined as "...the upper deck, abaft the mainmast."1 This was the location from which the Captain or Officer of the Watch commanded the ship both at sea and in port. Accordingly, there were strong Naval traditions about the quarterdeck; for one, any personnel coming aboard were required to salute the quarterdeck. Also, one side of the quarterdeck - port or starboard, or sometimes the "weather side" - was reserved for the use of the ranking officer on deck (Captain, Admiral, officer of the watch) and could only be entered by their permission. This gave the CO a measure of privacy for thinking and pacing, things that are difficult to do in the more crowded areas of the ship.
On ships with high-roofed rear cabins, such as poop cabins, the quarterdeck included the poop deck atop them. Generally, the helm was situated on the quarterdeck, allowing the officers access to those manning it. The use of one particular side of the deck as the desmesnes of the senior officer has a hazy past; some suggest that it was due to the Nore Mutiny of 1797, but there is evidence of officers preferring a side prior to that. The New York Times article referenced above offers one explanation. Since the ladders down to the decks below criss-crossed, someone on the port side who descended to the cabin level would end up on the starboard side - and Captains and Admirals generally took the starboard side staterooms in the cabin. Hence, the port side of the deck above would be convenient.
1: Hamersley's 'Naval Encyclopedia', quoted in The New York Times, "Change in Quarterdeck." July 5, 1896; page 14.