Supplies of electricity come in all shapes and sizes. The computer you are using is probably plugged in to the mains - but you might be reading this on a mobile phone!
Small things - like mobile phones - often run on batteries. But you have to plug them in to the mains to recharge their batteries!
Connecting 230 V to a mobile phone battery would make it explode (don't try it!). To recharge safely a lower voltage is needed. The mobile phone charger contains a transformer to do this.