Most DSLR and mirrorless cameras have a hotshoe on top into which you can connect a speedlight flash gun. But why would you want to use a bulky speedlight flash on your camera if the camera already includes a built-in flash?
Speedlight flash units are much larger than the flash built into the camera, and require their own batteries. This means that they can give a much greater power output than a small pop-up flash.
With a camera's built-in flash, you might sometimes find that the flash isn't powerful enough to light your subject fully. You have to compromise by using a higher ISO or larger aperture to get the subject lit nicely. With a speedlight flash you are much less likely to have issues with the flash not being powerful enough.
Having more power in your flash gives you more control in allowing you to overpower ambient lighting. You can use a fast shutter speed and small aperture (or add a neutral density filter), so that ambient light contributes very little to the scene. With the flash set at or near full power, the flash then becomes the dominant light source.
(Note that even with a speedlight flash, overpowering bright daylight will be difficult - you may need multiple flashes synchronized together to give enough power for this).
Shoot longer and wider
Another benefit of having more power is that you can light subjects with your flash that are further away. The further away from the flash a subject is, the smaller the amount of light from the flash that actually reaches the subject. (Because the light from the flash spreads out over the distance and so is less concentrated when it reaches the subject). The extra power of a speedlight flash gun allows you to compensate for this.
Many external flashguns also feature a zoom head. This allows you to control how narrow the beam that the flash emits is. By zooming the flash head when shooting a subject further away you can get a well lit subject without having to adjust the flash power.
The zoom of the flash is typically measured in millimeters, corresponding to the 35mm equivalent focal length of the lens you're using. Most flashes with zoom heads go from around 24mm to 100mm. For work with a telephoto lens you can buy add-on accessories that narrow / focus the flash beam even more, such as the Better Beamer.
As well as allowing you to get well lit images of subjects further away, a speedlight flash can also give good coverage for wide-angle lenses. With a pop-up flash, when using a wide-angle focal length you will find that the flash power drops off towards the edge of the frame, giving dark edges. This can be a nice effect sometimes, but other times you will want the scene lit more evenly from left to right.
Most external flashguns allow setting the zoom head of the flash to a relatively wide-angle, then you can flip down a wide-angle diffusion panel and / or add a small diffuser to the flash for even wider coverage.
Some cameras don't feature manual control over the flash power - they only allow you to apply positive or negative flash exposure compensation. While this is fine for most situations, sometimes a large enough compensation cannot be dialed in to give the lighting you want.
Most (but not all) external speedlight flashes have manual power controls. This gives you much better control over the lighting. If you want to blast your subject with flash to create a high key image, you can set a high flash power. This is much more flexible than being limited to just adjusting a small amount above / below what the camera thinks the flash power should be.
The majority of speedlight flashes feature a head that can be titled, and most allow swiveling the head as well. This allows you to tilt or swivel the flash head so that rather than pointing directly at your subject, it is instead pointing at the ceiling or a nearby wall.
When you take a photo, the light from the flash then bounces from the ceiling or wall, and back onto your subject. The ceiling / wall acts like a giant reflector, and this gives much softer and more pleasing lighting than direct flash.
Some of the latest mirrorless cameras do allow you to use bounce flash with their pop-up flashes. But using bounce flash requires quite a bit of power, so a speedlight flash is much more suitable for this type of lighting.
The flash built into your camera draws its power from the camera battery. So the more you use your camera's flash, the quicker the camera's battery will run out.
With an external hot shoe flash, the flash will use AA batteries, and so won't deplete the camera battery. This does mean that you need to carry extra batteries with you just for the flash. But spare AA batteries for a flash are typically much cheaper than spare proprietary camera batteries.
Use off camera
This is probably the main reason people buy speedlight flash guns - to use them off camera. Using off camera flash allows you to get much more interesting lighting that is just impossible with on camera lighting.
I've already written an article Why use off-camera flash? So I don't want to repeat myself too much here. But even if you buy a speedlight with the aim of just using it in the camera's hot-shoe, it's worth giving off-camera flash a try at least once to see the difference it can create in your images.
One of the benefits of interchangeable lens cameras is that you can upgrade the camera body to a newer model, which will work with the lenses you already have for your old model. In the same way, a speedlight flash that you used with your old camera can be used with the newer camera.
Even if you're changing the brand of camera that you use, most flash guns will work with any camera that features an ISO standard hot-shoe. TTL flash and other advanced features won't work, but so long as the flash allows you to manually set the power, it can still be used.
One caveat to that is flashes designed for old film cameras. These can have a high trigger voltage that could fry your digital camera. If you have an old flash from a film camera you'd like to use with your digital camera, make sure that you check the trigger voltage is safe first.
Some speedlight flashes feature special modes, such as a stroboscopic mode. This allows the flash to rapidly pulse on and off. Not an effect you often want, but it could come in handy sometime.
Some camera manufacturers (Canon) only allow 2nd curtain sync (rear curtain sync) flash when a speedlight is used. 2nd curtain sync can be very handy when you want to capture a moving subject while keeping the subject sharp at the end of the movement. Note though that not all speedlights support 2nd curtain sync - you will need to check before purchasing.
Use with light modifiers
While there are a few light modifiers designed for use with pop-up flashes, there are many many more designed for speedlight flashes. These modifiers allow you to shape, diffuse, or color the light as you wish.
You can use snoots for creating a narrow beam of light, bounce cards for creating larger, softer light, or colored gels for coloring the light. In theory all of these things are possible with a pop-up flash too. But the larger size and the shape of most flash guns means that creating and attaching light modifiers to a speedlight flash is much easier.
So, as you can see, there are quite a lot of different benefits to using a speedlight flash rather than the flash built into most cameras. The main disadvantages to speedlight flashes are the cost and size.
Now, I wouldn't suggest you always carry a speedlight flash around with your camera. But carrying one when you're expecting that you're going to need flash is a good idea. The extra power of a speedlight flash, and the ability to use it off-camera can be very beneficial.
But if you're not expecting to use flash, then leave the speedlight at home. If you do come across an instance when you need flash, well, you've still got the camera's built-in flash, which should work in a pinch.
Regarding the cost of external flashes, if this is an issue for you, then I'd suggest looking at some of the cheaper third party flashes available on eBay. If all you need is a flash with manual power control that will fire when the camera tells it to, then you can pick up a basic flash pretty cheaply.
Some third party flashes even offer better specifications than the manufacturer branded ones, despite costing less. I would always recommend searching online for user reviews before purchasing though. You want to make sure that the flash is reliable before spending any money.