The short answer is because they can.
Don’t for a second think that yeast have brains and that they are producing alcohol for our benefit! The truth of the matter is, the ethanol is a byproduct of a food system that allows yeast to grow, make energy and reproduce. Yeast belong to the Fungus Kingdom. They are a single cell and generally reproduce by budding. During their life processes, they basically spit out ethanol and carbon dioxide as they process their “food”, which is sugar. The series of reactions are chemical ones.
Happy yeast produce ethanol from the sugars in our fruit, and you’ll be happy they did!