When enabled, this feature will allow users see Nearby devices (a bit like Bluetooth) and you can then select the visibility levels to your contacts or just toggle this feature off if you do not want it turned on.
If you have the “Nearby Sharing” feature turned on, you should be able to see when someone is trying to share something nearby, even if you may not appear on the sender’s device. You can click on notifications to become visible to other devices to receive files. This feature works for files like videos, photos and other content like URLs or tweets. Google has confirmed that it intends to bring this feature to all devices from Android 6 (marshmallow) and up. Although this feature is still only in limited Beta testing, it would be great to see it finally released to end-users as a quicker and more effective means of transferring files and other shareable information among Android devices. References