In the begining, phasers just sort of hung there on the crew members hip until they reached for it. Granted, there were times when they wore belts with holsters for the weapons, but sometimes the phasers just dangled there with no visible means of support... How did that work? What was the theory and how did the prop department pull it off?
Here's a much clearer view - it appears to be velcro:
Edit to add (post question-edit): Before posting this answer, I had also thought it was supposed to be some sort of magnetic system (like the other answers mention), but couldn't find any evidence. It may have made it into one TOS episode, as I do not have any technical manuals or novels, but I cannot remember for sure. Instead I found the above image, where the patch has the same fuzzy quality that velcro has.
The Star Fleet Technical Manual refers to a "magnatomic adhesion area". The manual isn't canon (though illustrations from it have been used in movies), and I don't recall the word "magnatomic" ever being used in any series or movie.
Apparently "magnatomic adhesion" looks and sounds like velcro.
I don't have it any longer, but I once had an 'official' Star Fleet cadet manual that had Phaser and Communicator schematics. It pointed to the handle of the type II Phaser and said 'magnetic adhesion to body', which I took to mean 'uniform'.
While Velcro was used on the set (presumably because they fell off too easily with magnets), the 'tech' was described as magnetic, in-universe.
A screen-used prop of one of the phasers from Assignment: Earth went on sale a few years ago. The auctioneer provided a wealth of details including that the velcro on the side of the phaser (which you can see clearly in the photo below) still contains fibres from the original uniforms.
Some other keys aspects in the authentication of this phaser include, very importantly, a match of the uniquely patterned silver foil material on top of its hand phaser to the foil on the Greg Jein TOS Hero Phaser pistol, and the identification of a tiny mold flaw / accent line defect in its rear body fin appearance which is a perfect match to a mold flaw observed on a different phaser seen in a close-up screen capture from the Original Series episode "Spock's Brain". Additionally, high resolution photography of the Velcro on the hand phaser has revealed some gold, blue and red TOS velour Starfleet tunic fabric traces still trapped in the Velcro - exciting remnants from production on the Desilu soundstage 49 years ago!
It is velcro soft pasted and glue to a leather belt witch in the 1960s lapd used for a duty belt watch Adam 12 leather and velcro. I used a safarieland duty belt with no buckle for 30 years as a cop. I made my tos duty belt from long velcro from walmart. This was for a Halloween party last year. The velcro is 7.45 for a box I used 2 of them. I took off the stick side plastic off and combined both soft sides togeather. It looks great. The other tos belts run 75 or 90 dollars screw that. I then made the velcro patch the same way but I taped one soft side to the ruff side. Then stuck the ruff patch to the soft side of my duty belt. Done. You then you peal of the plastic from the velcro and stick it to the communicator and phaser right or left side.
Really late to this discussion but I also assumed they used Velcro to hold the props. But since the 1960s we have seen a lot of research into the microfiber adhesion biology that geckos and insects use to adhere to surfaces. It is my understanding the the product sold as "Alien Tape" uses a version of the tech of nanofibers. I think in Star Trek something similar was used for the TNG and later comm badges.