Screen overlay feature is generally safe as it provides security to the device by preventing the malicious application from gaining the sensitive data on your phone. It also provides the users the convenience to switch between the apps or use the other app while being on the current app.