One is not necessarily better than the other two, but each type of equipment has its own advantages and disadvantages. Free-weights are typically the toughest to control of the three since you have full control to move them in any direction. This can be a good thing in the right hands, or a bad thing in the wrong hands. If you are new to weight lifting and are not completely sure how to perform an exercise, free weights will be the most difficult to use properly. On the other hand, if you are an experienced lifter and use correct form, free-weights will give you the most control to manipulate an exercise for a better result. Everyone has a slightly different bone and muscle structure, and free-weights allow the user to adapt the exercise to fit them. For instance, on a chest press machine you can’t adjust the exact line of motion to get the precise angle necessary to target a very specific area of your choice.
Cables are the middle ground between free weights and guided machines. Cables give the user control, but not quite as much as free weights because they will always pull back to the same point. One advantage of that is being able to change the direction in which the weight is pulling from. Where a free weight will obviously always be resisting downward because of gravity, the user can choose the location that the resistance comes from with a cable.
Guided machines can be helpful for a beginner to learn how to perform an exercise, but can also be harmful. Machines are typically easier to use, but require very little control from the user. But more importantly- since machines usually only allow a set motion, the user can push or pull at an incorrect angle and never know it since the machine will still move the same way. This can lead to unnecessary stress being placed on the muscles of the rotator cuff, and can lead to a variety of injuries. There are still plenty of reasons to use these machines, but it should never be assumed that form is any less important on a machine than on free weights or cables! I usually have beginner clients learn an exercise on a machine, and progress toward cables and free weights shortly after. Even for advanced users there is still a place for machines in a workout routine though, especially isolation routines. Variety is very important in any workout program, and when working only 1-2 body parts in a single workout it can be helpful to use machines later in the workout when control is dwindling.
Clearly there is a place for all types of equipment, you just have to know how and when to use them!