Think about the flash as another leg of the exposure triangle. Instead of just ISO, shutter speed, and aperture, you now have to incorporate flash into the mix. I like to think of it as a separate exposure, completely separate from ambient/natural light exposure.
There are three important variables when it comes to flash photography:
- Flash power. You can control this manually, or by ETTL (Evaluative Through The Lens). This is just the technical term for "Let the camera decide the flash power." The camera does this by firing a very brief pre-flash right when you take the picture, a fraction of a second before opening the shutter. It compares the exposure without any flash, to the exposure with the pre-flash, and figures out about how powerful the flash should be for the actual shot - and it does all this faster than most people can perceive, after you press the shutter button but before taking the image.
- Flash distance to subject. Subjects close to the flash are going to be lit much more brightly than those far away from the flash. If you want to get technical, there's the "inverse square law" which says, if you double the distance from flash to subject, you need to quadruple the flash power to achieve the same illumination. In short, the flash will light up people in the foreground but NOT the buildings in the distance. With this in mind, you're now free to scoff and look down on those people who use a flash from the nosebleed seats at a rock concert.
- Size of flash, relative to subject. A small light source will give hard-edged shadows; a big light source will give soft-edge shadows. The closer the light source is to the subject, the bigger it is RELATIVE to the subject. The sun is pretty big, but it's also so far away that it's effectively a very small light source, so the sun makes hard-edged shadows. Most portrait photographers shoot the flash through some sort of large modifier like an umbrella or softbox; this effectively makes a large light source, which gives soft shadows which usually make fore a more pleasing portrait.
Some other considerations:
The flash is instantaneous. It doesn't matter how long your shutter speed is; the flash will always contribute the same amount of light. But, you've got to keep it slower than your flash sync speed, usually around 1/200. Any faster than that, and the timing of the rolling shutter won't line up with the flash.
With this in mind, you can adjust the balance of ambient to flash by adjusting the shutter speed. A slow shutter will let in a lot of ambient; a fast shutter will let in less ambient - but the contribution from the flash will be the same.
The aperture and ISO will affect the contribution of both flash AND ambient.
Light doesn't bend. It just doesn't, sorry, not for the purposes of photography anyway - though some marketing materials would have you believe otherwise. However, it does BOUNCE and REFLECT, which you can use kinda like bending. If you aim the flash at a wall or ceiling that's matte white, the light will bounce - the wall or ceiling become your effective light source, and they're usually pretty big relative to a person, so you can use a small Speedlight to still get a nice soft light for a nice portrait.
If you point the light at a shiny surface, it will reflect - this changes the direction of the light but not really the effective size. Bouncing off a mirror will still give you hard shadows on the subject.
The plastic caps that you stick on the end of the flash, often called "diffusers" even though they're not, don't directly make the light any softer (again, despite what the marketing materials would have you believe). Instead, they scatter the flash in every direction. This causes the light to bounce off all available surfaces, walls, ceilings, people. This light that's bounced from every direction CAN give the look of a large, soft light source, because the ceiling and walls are your light sources. But if you're outdoors, there's nowhere to bounce, so that plastic cap isn't doing you any good. Or if the ceilings and walls are black or some oddball color, then you're not going to get a desirable look from your scattered/bounced flash.
Practice, experiment, practice, read, practice.