A boost controller acts just like a wastegate. It is an open and shut valve. It works by preventing vacuum from reaching the wastegate. If the wastegate has no vacuum, it won't open to release pressure allowing you to reach higher boost levels.
Manual boost controllers works exactly like a wastegate. The are installed on the vacuum line between the wastegate and intake. The use a spring and a small ballbearing to hold boost. Just like an adjustable wastegate, you can adjust the preload of the spring inside the the boost controller to controll boost. Boost controllers are set at higher boost levels then the wastegate. For example, a stock wastegate holds only 14 psi. You set the boost the contoller to 17 psi. Your car will now boost to 17 psi via the boost controller. If you go over 17 psi, the boost controller will open, allowing vacuum to reach the wastegate, since the wastegate is only can only hold 14 psi, it will automatically open, droping boost to from 17 psi to 14 psi.
Electronic boost controllers work the same way, except they are usually more safer. Instead of vacuum, electronic boost controllers use boost sensors to open and shut their valves. You also get better controll over boost with electronic boost controllers.
Pic below:
