Electronic music was originally developed using simple circuits, generally called oscillators to generate simple sounding tones but over time more and more complex circuits were developed to generate more complex sounds and sequences them together over time.
Today most electronic synthesis is done with prebuilt synthesizers using preset configurations for generating sound but for those still interested in learning greater detail and having greater low level control over audio synthesis, there are modular systems where one can put together a custom system using "modules" to perform different functions.
Here's quick intro:
It's quite open ended what you can do and can be a great hobby to learn electronics, music, mathematics and give a creative outlet for ideas. One of the first audio circuits I built was a distortion box for my friend who played electric guitar. The circuit cost less than $2 worth of electronic components and sounded great on an electric piano ;)
Here's a bit of a DIY video to modular synthesis
... and here's an example of what can be done with some time to set up long cycles and patterns (having some digital sequencing can definitely help) - 4 1/2 hours of relatively unattended generative ambient audio synthesis using a modular system. (I only listened to the first hour or so but it seems like something that could be enjoyable to let run in the background)
Folding Space