Electronic cavity plates. This is how I do it. The pros might do it other ways. I don't like large cavities so I only make them big enough for the controls I am using in the guitar. A lot of mine are single push/pull volume knobs so they are done with a 1 3/8" forstner. On the SuperRG I had 5-way, volume, tone on a carved top and back. I did most of the cavity with the forstner then cleaned up the bottom with my dremel by hand. If the guitar is flat I will do it with a router but since the carve makes it hard to use a regular router. A pin router would be great but who can afford that.
After getting the control cavity designed I make a plate. The plates are usually custom to the guitar but I try to base them from something you can buy. Like for this build it is an RG electronics cover. I run the piece of wood through the drum sander till it is the right thickness and cut it out with a scroll saw. I touch up the curves with the belt/disk sander. Align the grain of the plate with the back of the guitar and trace a line around it. I use the big router to rough in the recess. Then I cut up to (leaving) the pencil line with my dremel and a large cutter. This part is a feel thing.
Next up are some small neodymium magnets. Using a 5/16" brad bit I drill a hole and use a block to tap the magnet in. A little CA and some accelerator and we are done.
On the back of the plate I use the dremel, set to the depth of a small washer and route a recess.
I then use some thick CA and glue my washer in place. Sand clean.
On the curved body I wet the plate and clamp it in place until it dries.
Usually this makes the plate curve to the body. If not the next thing is to soak in hot water, clamp in place, use a heat gun.
Trussrod cover. 5/16" mag on the plate, magnet in the headstock.