The subject of disengagement and, possibly, the subsequent chase is one that fills chapters and even whole books on Age-of-Sail tactics. Determining the possibility of escape involves a large number of variables. This includes, the number of vessels involved on each side, the state of those vessels (age, loading, trim, damage, how clean the hull is, etc), the comparative skill and morale levels of the crews, the nationality of the vessels involved (which determined standing orders, training, etc.), the proximity of allied forces (e.g. other ships, harbours and shore defences) and, especially, the weather.
A book you should read is by Sam Willis - Fighting at Sea in the Eighteenth Century, The Art of Sailing Warfare (Boydell, 2008) which has two chapters on "Chase and Escape". (While the title refers to the 18th Century, much of what is covered will apply to tactics through the whole Age-of-Sail). As he notes -
Once two ships or fleets had made initial contact, one of two things would then happen: they would prepare to engage, or one would flee and the other would chase. It was rare indeed for two ships or fleets to meet and both be intent on action, and usually the aggressive party in some way had to force action on his enemy. The captains of both ships, therefore, now turned their minds to the question of speed.
Fighting at Sea in the Eighteenth Century, The Art of Sailing Warfare, S.Willis (Boydell, 2008) pg. 27
In a engagement between single ships, it's the individual captains who are responsible for the choice of tactics. They decide if and when to break off and attempt an escape from an action, or if they were the aggressor, how and if they make the attempt to chase. Again, there are many factors involved in making those decisions. For example, a British Royal Navy captain always had the Articles of War in mind which required him (on pain of death) to do his utmost in the face of the enemy. Other navies were less focused on the destruction of the enemy, especially if that conflicted with the mission that they were on, which gave their captains other priorities.
In fleet engagements, the captains had less scope for individual action. They had a responsibility to the fleet as a whole and were directly answerable to the admiral in command. Conducting an escape or a chase as part of a fleet was a very different proposition.
The whole purpose of a fleet was to achieve strength in numbers, and that required a certain degree of cohesion. A fleet strung our over miles of ocean posed relatively little collective threat offensively, and could offer little collective resistance defensively; a fleet in close formation, on the other hand, was a fearsome opponent. The basic problem for a fleet in chase, therefore, was that the basic building blocks of fleet performance, the performance of the individual ships themselves, was neither uniform nor reliable.
Fighting at Sea in the Eighteenth Century, The Art of Sailing Warfare, S.Willis (Boydell, 2008) pg. 31
Any captain of a vessel that broke away from an engagement, to escape, without permission or extremely good reason, would find himself in a very awkward position. In theory, the escaping fleet has the option of scattering, which makes it more likely for the faster vessels to escape, but that would doom the slower ones to capture or destruction. There were also other risks -
The dilemma facing the fleet commander in chase, therefore, was to go at the speed of the slowest performer or to sacrifice any hope of cohesion. Sacrificing cohesion was risky; it opened the fleet up to attack and brought with it a heightened risk of collision. If a fleet was committed to a general chase through individual action, with each captain free to do exactly as he saw fit to bring his ship up with the enemy as quickly as possible, the behaviour of each ship immediately became unpredictable. In fair weather this could be problematic, but if the weather turned foul, chaos was inevitable.
Fighting at Sea in the Eighteenth Century, The Art of Sailing Warfare, S.Willis (Boydell, 2008) pg. 32
In a general chase there was also the risk that the fastest vessels of the chasing fleet would get too far ahead of their own companions and risk being defeated by coming up on larger numbers of the escaping fleet. First contact would be the 'hottest' combat, with fresh gun crews and a full complement of guns on each side. So there was the potential for the fastest chasers and/or slowest of the escapers to be significantly damaged (which would reduce their performance) in such a situation.
Ultimately, the ability to escape or not wasn't simply the relative performances of the vessels -
It has been argued that once a chase had been established, with both ships sailing as fast as they could, the only chance of escape for a slower craft rested on 'shifts of wind, squally weather, or the blunders of the chaser'. It is a statement that implies both a passive role for the captain of the escaping ship and a sense of inevitability in the outcome of the chase, both of which are unjust. The outcome of any chase, however ill matched the ships or fleets, was characterised by a marked unpredictability; it was an activity in which everything remained uncertain.
Fighting at Sea in the Eighteenth Century, The Art of Sailing Warfare, S.Willis (Boydell, 2008) pg. 36
To answer the final part of the question — was escaping easier than boarding? — you might want to have a look at an earlier question on this site: Was there a way for ships to disengage from boarding actions?. In short, there were significant risks to boarding actions, so, for a ship that is potentially losing a battle, it's essentially a last throw of the dice. If your ship was still manoeuvrable, it was far more sensible to attempt to escape first (and boarding remained an option if that escape attempt failed).
Additional Recommended reading:
Naval Warfare in the Age of Sail, Tunstall/Tracy (Conway, 1990) - Concentrates mainly on fleet tactics.
Seamanship in the Age of Sail, J.Harland (Conway, 2009) - While not about warfare, this gives invaluable information about handling the sailing ships of the period.