The painting depictis George III's review of units of the Royal Navy at Spithead off Portsmouth in the summer of 1773. The original was painted by John Cleveley the younger in the same year. It is today the property of the National Maritime Museum in Greenwich, London.
In the foreground of Cleveley's painting you can see the royal barge, flying the large royal banner, coming up on the stern of HMS Royal Oak. Sailors are manning Royal Oak's yardarms, in order to present themselves and the ship for review by the monarch. The same spectacle is taking place aboard the other major fleet units at anchor in the painting background.
This process of having the ship's company line up on the yardarms is similar to the modern day review tradition of lining the upper decks of warships, and is formally known as "manning ship". The tradition is supposed to have originated as a means by which ships could show friendly intentions, as having the entire crew man the yardarms and upper decks meant that there were none left to fight the lower deck guns. Manning the yardarms for review in this way was formally removed from RN regulations in 1873, but remained in occasional use - at least in cadet ships - well into the second half of the 20th century.
Here you can see a photo of cadets of HMS Worcester manning ship for review in 1913.