Overall there are benefits to using both machines and free weights.
If I had to pick one or the other while comparing the two, I start to look at the benefits of functional training & strength you can build. Overall, there are more benefits to using dumbbells, barbells, kettlebells & cables vs. machines.
Machines still have their benefits. You can still make progress for strength, hypertrophy and endurance while using machines, however, because you can attain better results in all those categories and even more by using free weights instead, I believe most people should not heavily rely on them as the bulk of their training programs.
Range Of Motion (ROM)
When it comes to dumbbells, barbells, kettlebells & cables, the common benefit these types of equipment provide, is allowing you to use your own range of motion & a full range of motion while working through a particular movement pattern. Machines only provide a fixed ROM. For some people who have certain injuries, this could be seen as a benefit. On the flip side, often healing from some injuries requires gaining back full ROM; just start with very light weight. If you only train in a fixed ROM, you don't gain control of full ROM.
Strength & Mobility
Working a muscle through its whole range of motion builds more muscle and strength than working it part of way. This is because you strengthen the full contraction (muscle shortening) part of the movement as well as the eccentric contraction (muscle lengthening). It also makes the workouts more challenging. Often switching to working full ROM means decreasing the weight as the lift becomes harder. At the same time, having proper form often means training full ROM which also helps to improve mobility over time.
Stability & Function
With free weights, nothing impedes your movement so the body has to work harder to improve your stability since you have to control the load through its entire range. On the contrary, taking out the stability work can help to better isolate certain muscles and work them harder since you don't need to focus on balance.
Working on stability means you have more control and balance in your movements which helps to prevent injuries from occurring. Injury prevention is so important and is one of the main reasons I believe people should be exercising in the first place. Machines have often been marketed as a safer alternative, which can be true, however improving our stability is one of the best things we can do to prevent injuries from occurring.
For these reasons, free weights prove to be more functional as it better translates to how we move in our day to day lives.
In conclusion, although there are benefits to machines, free weights and cables offer so much more and should make up the bulk of a training program. Since machines provide a fixed ROM and can help to better isolate specific muscles, they should not be entirely neglected. Ultimately your goals will dictate the amount of exercises in your program that provide the functional elements of stability, mobility, strength, and ROM.