@GerryT @ebassi selections are the inter-app data transfer mechanism of X11. They are used to implement the clipboard, middle click paste, and drag and drop.
An application can request ownership of a selection, which will cause the previous owner to be notified it has lost ownership. It advertises that the data is available in one or more formats (e.g. plain text, images, html, etc).
Other applications can check the advertised formats and request that the selection be converted to one of them. The selection owner then sends the data in that format to the requesting app.
The way middle click paste worked was that an app would request the PRIMARY selection when the user selected something, and other apps would convert this selection when middle clicking.
The other part of the system was that if an app lost ownership of PRIMARY, it was expected to unselect whatever the user had selected previously. If they don't do this part, then the user can't tell what text would be pasted by the middle mouse button.