A screw driven straight into plastic will hold once or twice and then strip, which is why any plastic part that is assembled and disassembled needs a metal thread. A heat set insert is a knurled brass bushing pushed into a slightly undersized hole with a heated tip, so the plastic melts and flows into the knurling and locks it in place as it cools.
How installation actually works
A temperature controlled soldering iron with a shaped tip heats the insert, which is pressed slowly into the boss. The plastic around it softens and flows into the knurls, undercuts and flutes on the insert body. The insert is pressed until flush or slightly below the surface and then held still while it cools, because moving it while the plastic is soft is what produces a loose insert.
Hole size is the whole specification
Too large and there is not enough plastic to flow into the knurling, so the insert spins. Too small and the plastic displaces upward and forms a lip, or the boss splits. Insert manufacturers publish a recommended hole diameter and depth for each part number in each material family, and following that table matters more than any technique.
The boss around it
The boss must have enough wall around the insert to resist the hoop stress of installation and the load in service, and enough depth that the insert does not bottom out on the hole floor and stop short. On printed parts, orient the boss so layer lines are not the failure plane in pull out, and consider a slightly thicker wall than a moulded part would need.
Alternatives and when to use them
Moulded in inserts are stronger and need insert moulding. Self tapping screws for plastics work well for assemblies that come apart once or never. Press in inserts need no heat but rely on interference alone. Ultrasonic insertion is the production equivalent of heat setting and is faster and more repeatable at volume.
Questions people ask about heat set inserts
What is a heat set insert?
A knurled brass bushing installed into a plastic boss with a heated tip, so the melted plastic flows into the knurling and locks it in, giving a durable metal thread.
What hole size should I use?
The one the insert manufacturer publishes for that part number and material. Hole diameter and depth are the specification, and getting them wrong is the usual cause of failure.
Why do my inserts spin?
Usually a hole that is too large, so there is not enough plastic to flow into the knurling, or an insert that was moved before the plastic cooled.
Do heat set inserts work in printed parts?
Yes, and they are the standard way to get durable threads into them. Allow a slightly more generous boss and orient it so pull out is not along a layer boundary.