iPhone
Taptic Engine
Press the trackpad of a recent MacBook and it seems to click down, but it barely moves. A small motor under it kicks a weight sideways once, and your finger takes the kick for a click.
A weight on springs
The Taptic Engine is a linear actuator: a heavy slug carrying magnets, held between two springs inside a small metal can, with a flat coil beside it. Current through the coil pushes on the magnets and moves the slug along the can.
Every action has an equal and opposite reaction. When the slug shoots one way, the can, and the glass it is screwed to, is pushed the other way. That push is what you feel.
One kick, then stop
A weight on springs wants to keep swinging, and a swing that keeps going feels like a buzz, not a click. So the driver does two things. It pushes in time with the springs for a couple of swings to build a strong kick, then pushes against the slug's motion until it stops.
Pluck the slug in the figure and let go to feel the difference: with nothing braking it, it rings on for several times as long.
Buttons that do not move
Apple first used the Taptic Engine in Apple Watch, then in 2015 under the Force Touch trackpads of Mac laptops. On iPhone 7 in 2016 it replaced the moving Home button with a solid one that only feels like it clicks.