In addition to Drux's fine answer, Napoleon's ability to evade the British was down to a number of factors but miscommunication by the British played a very large part.
When Sir Sidney Smith was assigned to the Levant Squadron, he was also given a diplomatic mission by the British Cabinet. However, this additional role was not communicated to his superiors in the Mediterranean, Lord St Vincent and Lord Nelson. As a consequence, when he started direct communication with the Ottoman government (which was outside of his role as a naval Captain and inferior officer), they both took offence. Unfortunately, all three (Smith, Nelson & St Vincent), while very talented naval commanders, had family-sized egos to match. The same self-belief that made them great also made them unwilling to admit they might possibly be wrong.
The result was that neither St Vincent or Nelson were inclined to aid Sir Sidney and, at the same time, they did all they could to try to control and confine his actions even though they were many hundreds of miles out of touch with what was happening in Egypt. [Ironically, Nelson himself was guilty of the same 'disobedience' to his orders when it came to his handling of affairs in southern Italy, which he justified by stating he was better placed to make the decisions]. Even when St Vincent returned to England and was replaced by Lord Keith, the quality of communication didn't improve all that much.
When Sir Sidney finally arrived off Alexandria to take over the blockade from Sir Thomas Troubridge, he had just three ships, the 74-gun Tigre and Theseus and the 64-gun Lion. There were no frigates available as the few that were in the Mediterranean were assigned elsewhere. The Lion was taken to supplement the blockade of Malta, leaving Sir Sidney with just two British ships (and possibly a brig). Nelson had ordered Sir Sidney not to interact with the Turkish admirals and, therefore, the opportunity for a joint blockade was lost.
As noted in Drux's answer, it would appear that Sir Sydney's eventual plan was to tempt Napoleon into sailing for home so he could be intercepted. To this end, the Theseus was sent to sail to the west while, on August 12th, Sir Sidney on the Tigre made for Cyprus to restock with water and provisions. The hope being that Napoleon would see that the blockade was apparently lifted and make sail - straight into the Theseus. Unfortunately for the British several things went wrong with the plan.
Napoleon was much further advanced in his plans for returning than Smith believed and his small squadron was ready to sail before the Tigre could return (in fact, Napoleon reached France before the Tigre left Cyprus). When the Tigre arrived in Cyprus, they discovered that there were no provisions to be had and so they were significantly delayed in returning to Alexandria. In addition, the Theseus (which was out of contact with the Tigre) was also short of supplies and had made for Rhodes to replenish, where she too was delayed due to the island's Govenor being unwilling to assist. While at Cyprus, Sir Sidney sent a message to Lord Nelson to warn him that Napoleon might be attempting a return to France but this was sent on one of the returning storeships and it's unlikey that the letter would have reached Nelson in time to be useful.
So when Napoleon set sail, neither of the blockading British warships was present. Some accounts mention a British corvette or brig being sighted covering Alexandria but it wouldn't have been a match for the French frigates carrying Napoleon. There is a belief that Lord Keith's squadron sighted the French vessels but apparently the frigates weren't recognised as French and were not, therefore, intercepted. It's entirely possible that Lord Keith's ships were unaware at the time that Napoleon was even at sea.
"Beware of Heroes, Admiral Sir Sidney Smith's War against Napoleon", P. Shankland (Kimber, 1975)
"Overlooked Hero, A Portrait of Sir Sidney Smith", J.H.Parsons (Fireship Press, 2009)
"Nelson, The Sword of Albion", J.Sugden (Bodley Head, 2012)