You need to manipulate the camera tools to achieve the look you want for your subject.
The exposure of an image applies across the entire image frame. It isn't selective. If you expose the image for something that is really bright (the flowers, which have high illumination) then the rest of the image (in this case the background) will appear dark.
By adjusting your camera controls (iso, shutter, and aperture) to be more sensitive for the background's lighting to make it more visible (also known as "better exposed") then the flowers will appear to be blown out or extremely bright or white, appearing to lose all detail.
This is a balancing act due to the nature of the setting's conditions. You have a very bright light source on the flowers, and comparatively little lighting upon your background.
The simple solution here is to balance the lighting of the scene more appropriately. Add lighting on the background. Of course, that is easier said than done. You have to get one or more lights of the same (or similar) color temperature and proper power to compete with the sun (which is hard to do), and not add that light to the subject. Or you can try bouncing some sunlight onto the background with a reflector. Or you can cut down the sunlight's power by diffusing it with something like a sheet. Or you can move the subject (the flowers) out of the sunlight and use a reflector to bounce light onto the flowers and background at the same time. And you can use multiple bounce reflectors to provide multiple angles of illumination. This is part of the art of photography - the manipulation of light, and the planning of your scene.
You are correct in assuming your phone camera can be doing "magic" behind the scenes. It can be blending exposures for the bright subject and dark background to create a single image where more of the image is exposed. Sometimes this can meet a standard called HDR. You can do this too. If you mount your camera on a stable surface (like a tripod), you can take multiple photos at different exposure settings and use an image editing software to manually blend the brightness of two photos together to create a more balanced single image.
I've provided you with a lot of ideas. But that may not be easy to go through. Here is what I suggest doing to start:
Your primary light source is the window and the sunlight. Change the direction you are photographing, from facing the window and outer wall to photographing towards the inside of the room, or in other words, you stand near the window and point your camera in toward the room. Put the flowers on a table. This will probably illuminate the background a little better. For your camera settings, the lower the ISO the better the image quality can be. Then you can adjust your aperture and your shutter so that the highlights or bright areas of the flowers are not oversaturated and blown out. Now, in an image editng software like photoshop/lightroom or gimp/darktable/rawtherapee, you can try to adjust your contrast, darks and brights to balance it a little more.
From here, you can go through other options and techniques to learn how to control light and scenes.