Mould-in inserts are fitted during the manufacturing process. They are used in both thermoplastics and thermoset plastics.
The external structure of a mould-in insert is interchangeable. They often have knurls and indents which give the plastic something to take to and increase pull-out resistance.
Plastics are moulded into shape, often through a process called injection moulding and inserts can be added to the plastic during this process. Injection moulding sees the plastic melted and then injected into two-part moulds. The plastic is then cooled very quickly to set it.
Mould-in inserts require special equipment for installation, not just the usual items needed for injection moulding. This can make it an expensive procedure, but this is a manufacturing process and not generally a job for a DIYer.