They are both beneficial. I like free weights for my heavier lifts and also for compounds. Machines are great as well. One can increase time under tension with machines easier than with free weights. Also, depending on the machine, think cable curls, the muscle is always going to be under some type of tension. Also, free weights are great for intensity techniques such as drop sets, contracted holds, rest pause, etc. Sure, one can do rest pause with free weights, but if one does not have a spotter, machines would be safer.
Short answer, use both.