They use different chemicals.
Batteries work by allowing electrons to move from one chemical to another, but only when the ends of the battery are connected. This is called an electrochemical reaction.
The electro potential depends on the chemicals involved.
For the 1.5V the battery uses Zinc and Maganese-Dioxide. The electric potential (voltage) between these two chemicals is 1.5V, but these aren’t suitable for rechargeable batteries due to the reverse process not getting the full charge back, and potential for them to burn/explode if you try.
To make higher voltage batteries they link up cells. A 9V battery is basically six 1.5V batteries in a wrapper.
For rechargeable lithium ion batteries the electric potential of the chemicals is 1.2V, but for this trade off of voltage you get reliable recharging.
Latest Answers