Use long-set (or time to cure) epoxy, not the 5-minute stuff. It seems to stick better. It depends upon a physical bond between the 2 surfaces, so the more places you make for it to grab on to in both places, the better your bond will be. The glue itself sticks to itself because there is a chemical bond within it to hold itself together.
I use the analogy of using plaster putty filler in my plaster walls as an example. (I have 2 boys so holes sometimes appear on their own.) Even though the plaster on the wall is rough, and was dampened, my patches always seemed to fall out. Then I hit on using a few flat-head screws in to the hole screwed in there. The patch stuff filled in underneath the heads, and provided for the mechanical bond I needed to keep the patch stuff in there.
Some folks (like Dave Person and his small inlays) use a reverse draft on the inlay and undercut ihe hole, and then peen the metal in place to form the mechanical bond. This is quite common on barrel inlays (like for a signature plate) and when using a soft inlay materiel like sterling or fine silver. The hard steel barrel makes for a great anvil. The same technique is used for copper rivets and muzzle caps.