Sea trials may be requested following a pre-purchase survey report, where the surveyor requests, or the client desires, to see the vessel in its marine environment and generally tested like in cannot be out of the water.
There are several elements of any vessel that cannot be tested while the vessel is both out of the water, and in the water but not underway.
Sea trials focus on operationally testing all the parts of the vessel which cannot be tested in other environments. This includes the engine's operation, stern gear and packing glands, steerage, below waterline seacocks and valves, sails, standing and running rigging, and all associated blocks.
On the land running a vessel's engine up to temperature is just not practical. Even if a water supply can be attached to the engine's cooling system, by the time the engine is up to temperature there will be a small river, or worse still a pool of smelly exhaust water in the the boatyard. Running up the engine for just a few minutes wont offer much insight into the condition of the engine either.
While on land, especially when vessels are so often precariously chocked up, hauling the sails up/out on a sailing yacht is a risky business. Therefore, although the surveyor wants to test everything, they simply do not earn enough money to risk causing a domino effect of all the various craft in the boatyard. If the sails are not inspected in situ, then the relative running rigging and blocks cannot be inspected for chafe and operationally tested respectively.
Sea trials give insight to how the engine runs when up to temperature, and therein the charging ability of the engine's alternator. It allows inspection of stern gear and packing glands liable to leaks, and any leaks of seacocks and valves below the waterline. For sailing yachts this allows the opportunity to test all outhaul and halyard lines to ascertain the condition of sails, lines and blocks. If a breeze is present, this offers the ability to test winches, jammers and cleats underload, as well as the tension in the rig, and any associated flexing in the deck. Furthermore, testing the steering systems underload, and for sailing yachts testing the balance of the rig, and any dangerous faults therein such as lee-helm.