Batteries are just one type of a DC power supply and are used when you need DC current that is portable or in something that’s not connected to AC power.
Electronic boards can make DC current out of AC using a combination of transformers, rectifiers, and filters. That’s what’s happening inside all of the electronics in your house. They are able to make the DC current out of your AC household power supply. You’ll learn more about this in the Basic Electronics module. Keep an eye out for the info, and feel free to follow up with more questions after going through that module!