I'm not an electrician or know anything about building or wiring anything to do with electronics. All I know is you take a plug, insert it into an outlet, and hope nothing explodes.
However, when I saw this video I began to wonder "oh it's for locks...just like the thumbnail shows". Watch and learn the real reason.