Before we dive deeper into understanding why and when we need to use RAW format while shooting photos, we need to understand what RAW format means. A camera RAW format file contains minimally processed data for an image. Since it is minimally processed it holds onto most of the information the sensor has captured; this allows a lot of flexibility in post-processing to recover shadows/highlights when dealing with scenes which have great variance in dynamic range and in playing around with colors, white balance, blacks/whites of the image.
I generally only use RAW format when dealing with scenes which have high dynamic range, otherwise I mostly prefer clicking fine quality JPEGs. I do this because for most other post-processing tasks fine JPEGs are good enough, especially if your images are mostly meant for online consumption. One example of a scene where I'd use RAW format for is below, as you can see RAW allowed the shadows to be brought back cleanly and created an image that would have only been possible using expensive lighting setup.
Why not always click RAW? Simple answer is, RAW format creates files which are much larger than JPEGs and thus expensive to backup; they also require more compute resources for editing.
Another question that many people ask is which software would you use to edit RAW images. While Adobe and DXO provide great payed editors, I have mostly gravitated towards free options because I am just an enthusiast. If I was making money from it then I'd definity pick DXO's RAW editor.
I use Affinity Photo for general photo editing. As Affinity Photo has pretty average RAW editing ability, I first edit the image either in Rawtherapee or in Nikon's Capture NX-D before doing final edits in Affinity Photo.