In 5e, an opponent provokes an opportunity attack from PC when it goes out of the PC's reach. That means, if a PC is using a reach weapon and has 10-feet reach, an opponent can run freely within a 10-feet radius circle centered on the PC. For that, sometimes, using a reach weapon is a bad idea...