The Germans did not press their attack as strongly as they could have. If they had, it's very likely the evacuation would have been far less successful.
Why they didn't do so is the subject of a massive amount of study over the years. But it really looks like it was mostly a matter of them not wanting to risk their tanks - losses to tank units had been quite heavy, and the ground around Dunkirk was not ideal for tank operations. So they stopped temporarily and that gave time for the evacuation to take place. Hitler and quite a lot of his Generals seemed to have believed at the time, that if Britain was allowed to withdraw across the channel, some sort of peace could have been negotiated - in essence that Britain would have agreed to a peace settlement in exchange for leaving Germany to rule Europe. That was a severe miscalculation in the end, but remember Britain was not capable of returning to Europe until it did so as part of a force combined with the United States. If the United States had remained a non-combatant power, it would have been years, if ever, before Hitler's rule in Europe would have been challenged. Churchill's speeches I quoted earlier show he was well aware that all Britain could do was fight a holding action to survive until the US became involved.
I am not a serious student of WWII but do fine it interesting.
My guess is the German Army was too exhausted to continue and took a few days to rest, reorganize etc. They thought they had the British trapped and had the time.
Similarly, I have read criticism of General Meade for not following up after Gettysburg. The truth is he couldn’t. Lee retreated to a strong position and according to Encyclopedia Britannica, the North lost even more than the South.
That totally surprises most people. The casualties were relatively even but the South could not afford that.